While searching through U&L I noticed a fair amount of questions asking how to script the generation of ffmpeg command lines like these:
ffmpeg -i video.mp4 -ss 00:00:00 -t 00:10:00 -c copy 01.mp4
ffmpeg -i video.mp4 -ss 00:10:00 -t 00:10:00 -c copy 02.mp4
ffmpeg -i video.mp4 -ss 00:20:00 -t 00:10:00 -c copy 03.mp4
In researching solutions for this I stumbled across this ticket in the ffmpeg issue tracker, titled: Split an input video into multiple output video chunks.
This ticket highlights a patch that would allow you to finally be able to provide a list of time points to cut a video into smaller sections with a single command line like this:
$ ffmpeg -i input.avi -f segment -segment_times 10,20,40,50,90,120,180 \
-vcodec copy output02%d.avi
The patch appears to have been released in this revision of the code repository:
commit 2058b52cf8a4eea9bf046f72b98e89fe9b36d3e3
Author: Stefano Sabatini <[email protected]>
Date: Sat Jan 28 22:36:38 2012 +0100
lavf/segment: add -segment_times option
Address trac ticket #1504.
I downloaded this statically built version of ffmpeg, ffmpeg.static.64bit.2013-10-05.tar.gz from the ffmpeg site, but it apparently didn't include that switch.
$ ./ffmpeg --help |& grep segment
$
Has anyone been able to get this new switch working?