How to control key-frame generation of ffmpeg?

  1. It is possible for ffmpeg to generate Key frame at irregular interval, based on scene change detection.

  2. key frame interval can be controlled by GOP size. the following options can be used

-g (FFmpeg)
Keyframe interval, also known as GOP length. This determines the maximum distance between I-frames. Very high GOP lengths will result in slightly more efficient compression, but will make seeking in the video somewhat more difficult.

-keyint_min (FFmpeg)
Minimum GOP length, the minimum distance between I-frames.

Leave a Comment