video – FFMPEG segment_times arg makes command too long
You’ll have to perform this task in stages. Instead of creating all segments in one command, do it piecemeal.
Let’s say you have 15 segment split points s1..s15.
ffmpeg -copyts -i input.mkv -map 0 -c copy -segment_times s1,s2,s3 -to s4 -segment_start_number 0 -reset_timestamps 0 -f segment out_%03d.mkv
ffmpeg -copyts -ss s4 -i input.mkv -map 0 -c copy -segment_times s5,s6,s7 -to s8 -segment_start_number 4 -reset_timestamps 0 -f segment out_%03d.mkv
ffmpeg -copyts -ss s8 -i input.mkv -map 0 -c copy -segment_times s9,s10,s11 -to s12 -segment_start_number 8 -reset_timestamps 0 -f segment out_%03d.mkv
ffmpeg -copyts -ss s12 -i input.mkv -map 0 -c copy -segment_times s13,s14,s15 -segment_start_number 12 -reset_timestamps 0 -f segment out_%03d.mkv
Read more here: Source link
