How to split a video using FFMPEG so that each chunk starts with a key frame?

The latest builds of FFMPEG include a new option “segment” which does exactly what I think you need.

ffmpeg -i INPUT.mp4 -acodec copy -f segment -vcodec copy -reset_timestamps 1 -map 0 OUTPUT%d.mp4

This produces a series of numbered output files which are split into segments based on Key Frames. In my own testing, it’s worked well, although I haven’t used it on anything longer than a few minutes and only in MP4 format.

Leave a Comment