

Just pass the natural cut point offsets to ffmpeg, telling it to pass the encoded A/V through untouched by using the "copy" codec: $ ffmpeg -i source.m4v -ss 0 -t 593.3 -c copy part1.m4v I think you should be using a video editor or player to find natural cut points just shy of 10 minutes apart.Īssuming your file is in a format that YouTube can accept directly, you don't have to reencode to get segments. That will put cuts right in the middle of sentences, even words. You pay for the latter with a certain complexity.Īll that aside, I don't think you really want to be cutting at exactly 10 minutes for each clip. The linked article describes fast-but-inaccurate and slower-but-still-accurate alternative formulations.


Where I have it now is slow but accurate. Wrapping this up into a script to do it in a loop wouldn't be hard.īeware that if you try to calculate the number of iterations based on the duration output from an ffprobe call that this is estimated from the average bit rate at the start of the clip and the clip's file size unless you give the -count_frames argument, which slows its operation considerably.Īnother thing to be aware of is that the position of the -ss option on the command line matters. $ ffmpeg -i source-file.foo -ss 1200 -t 600 third-10-min.m4v $ ffmpeg -i source-file.foo -ss 600 -t 600 second-10-min.m4v $ ffmpeg -i source-file.foo -ss 0 -t 600 first-10-min.m4v
