I have ffmpeg installed in my linux box. I am using it to split files into equivalent segments. So far I have test two approaches: 1. Create a bash script that grabs the file durationffprobe and then performs a math equation to get the file split in equal segments 2. Do it directly from ffmpeg using segment_time. The first method is consistent for the most part(1 or 2 secs off in some segments) in splitting segments into equivalent sizes but there is some frame loss in the segments and is very slow. The second method by far is the quickest in splitting the video file since I am directly running ffmpeg without having to do an external duration calculation. How could I get strict equivalent segment sizes with ffmpeg?

ffmpeg -i input.mp4 -c copy -map 0 -segment_time 10 -f segment output%03d.mp4
  • Did you find any solution?! – Dr.jacky Aug 23 '15 at 11:48

You cannot not do this in the general case unless you want to re-encode all of the mp4's which would likely violate your desire for speed.

The segmenter is likely the best option for speed and leveraging other peoples work.

Note: You would have to do a lot more juggling than just finding desirable time-stamps if you wanted to manually split the videos.

Edit: If you're okay with re-encoding then convert to yuv and then use segmenter. This will reduce video quality and will not handle your sound.

  • +1 Ok let's say I re-encode the videos and do more juggling. This still will be faster then doing it in a script. Could you post an example of it. I just need a general idea. – Code_Ed_Student Oct 11 '14 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.