3

I am trying to exrtact key frame information from a mp4 video using ffprobe with the command:

ffprobe -select_streams v -show_frames FILE_NAME  2>/dev/null

I am getting the list of all frames. From these, I searched for frames with pict_type=I to recognise I-frames. However, there were about 10 of the total 700 I frames which had

media_type=video
key_frame=0
pict_type=I

What are these frames? If these are I-frames what makes them not a key_frame?

3
  • What is the definition of a "key frame' in this context?
    – Jim Mack
    Commented Mar 14, 2015 at 16:24
  • I am not actually sure. From what I knew, it is the I-frame, but from the ffprobe output, there are I-frames which are not key_frames. That is what my question is. Commented Mar 14, 2015 at 17:43
  • Without context, or a definition from the ffprobe docs, there's no way to know. But I have to ask -- if you don't know what they are, why are you looking for them?
    – Jim Mack
    Commented Mar 16, 2015 at 22:46

1 Answer 1

4

This means although it is and I-frame, the decoder might still use/need previously sent frames for decoding. In contrast if key_frame=1 this would be an IDR-Frame (Instantaneous Decoder Refresh).

Citing from Ian E. G. Richardson's H.264 and MPEG-4 Video Compression:

An encoder sends an IDR (Instantaneous Decoder Refresh) coded picture (made up of I- or SI-slices) to clear the contents of the reference picture buffer. On receiving an IDR coded picture, the decoder marks all pictures in the reference buffer as ‘unused for reference’. All subsequent transmitted slices can be decoded without reference to any frame decoded prior to the IDR picture. The first picture in a coded video sequence is always an IDR picture.

This may have impact on random access to a video. Simply said, IDR frames make random access more robust.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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