[FFmpeg-user] Difference between i-frames and key frames

Ferdi Scholten ferdi at sttc-nlp.nl
Sat Oct 7 23:28:56 EEST 2023



On 07-10-2023 17:20, Ulf Zibis wrote:
> Hi,
>
> what is the difference between i-frames and key frames?
>
> And how many other frames are between i-frames or key frames in mp4 
> files, created with ffmpeg and with default settings?
>
> -Ulf
In mp4 containers I-frames are key frames.
The amount of inter-frames (P and B)  between intra-frames can vary, 
depending on codec settings and source material. Most commonly used with 
mp4 is h264 nowadays, but multiple other codecs are supported by this 
container.
When using closed GOP, there is a defined number of frames between 
I-frames, unless de encoder senses the need for an extra I-frame like on 
scene changes. When used in open GOP, there can be very many B and P 
frames in between I-frames, depending on the amount of changes in the 
source. Open GOP will be more efficient in some cases, like streaming 
media because generally it uses less bandwidth and has better 
compression as I-frames only occur on scene changes when the encoder 
deems this necessary. When you want media to be searchable (fast 
forward/reverse) with fixed intervals, you need closed GOP.

I do not know what the default for ffmpeg is.


More information about the ffmpeg-user mailing list