All Projects → tsoding → markut

tsoding / markut

Licence: MIT license
Autocut the Twitch VODs based on Marker

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Markut

Given the VOD of the stream and the markers that are exported as a CSV file, generate a video using ffmpeg that cuts out part of the VOD according to the provided markers.

thumbnail

Quick Start

Install Go and ffmpeg.

$ go build markut.go
$ ./markut final -csv marks.csv -input vod.mp4 -delay 4

Input arguments

  1. -csv marks.csv - CSV file with the first field containing timestamp of the cut in seconds starting from the beginning of the video. The amount of marks must be even as they form video chunks. See the screenshot at the top.
  2. -input vod.mp4 - the input video file that is chopped into chunks.
  3. -delay 4 - the offset in seconds added to every mark in marks.csv. If the marks are imported from Twitch this might be very useful because Twitch marks have around 4 seconds lag.

Output files

  1. Sequence of chunks chunk-00.mp4, chunk-01.mp4, etc. The amount of chunks depends on the amount of marks in marks.csv
  2. ourlist.txt - instruction file to concatenate all the chunks. https://trac.ffmpeg.org/wiki/Concatenate
  3. output.mp4 - final concatenation of the chunks.

Adjusting the -delay with markut chunk

With markut chunk instead of markut final you can render only one chunk of the final video to see if the delay is aligned properly and adjust the delay as needed:

$ ./markut chunk -csv marks.csv -input vod.mp4 -delay 4 -chunk 0

After the delay is chosen you can use markut final to render the final video:

$ ./markut final -csv marks.csv -input vod.mp4 -delay 4

It will try to rerender some of the existing chunks generated by previous markut chunk calls making ffmpeg complain about already existing files. We intentionally don't pass -y to ffmpeg to let you answer N in case you are ok with using already existing chunks in the final video.

Ignored Markers

If the second field of the CSV file with markers contains the string "ignore" the marker is not considered as part of the chunk end.

Inspecting Cuts

You can inspect the final cuts without rendering anything by using markut inspect:

$ ./markut inspect -csv marks.csv -delay 4

Environment Variables

  • FFMPEG_PREFIX - if the variable is defined then markut uses $FFMPEG_PREFIX/bin/ffmpeg as the path to ffmpeg.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].