Cutting a video into segments with FFmpeg

Creating video segments from a large video can easily be achieved with FFMpeg, the process is fully automated complete with sequential file naming.

Cutting a video into 5-minute segments can be done with the following:

ffmpeg -i videotocut.mp4 -c copy -map 0 -segment_time 00:05:00 -f segment segment%03d.mp4

This will save the outputted files as segment01.mp4, segment02.mp4 etc…

It will copy the input video and only do the cut with no encoding, this means it will run at a very quick rate.

Note in cases the video won’t be a perfect cut at 5:00 as it will cut on the next keyframe after 5:00, often the length will still be 5:00 as there are many (25/30/60) frames per second.

To do a different length of segments simply change the 00:05:00 value. 00:10:00 is 10 minutes and 00:02:00 is 2 minutes as an example.