[FFmpeg-trac] #2074(undetermined:new): decoded frame picture type does not match packet flags

FFmpeg trac at avcodec.org
Fri Dec 28 05:24:22 CET 2012

#2074: decoded frame picture type does not match packet flags
             Reporter:  mrhines      |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  1.0.1
  undetermined                       |               Blocked By:
             Keywords:  key frame,   |  Reproduced by developer:  0
  decode, mpeg2                      |
             Blocking:               |
Analyzed by developer:  0            |
 Summary of the bug:

 I'm routine decoding an MPEG2 video, like this:

     avcodec_decode_video2(codecCtx, frame, &got_frame, &packet)

 .. and upon encountering a key frame, I perform a sanity check, like this:

     if(got_frame && (packet.flags & AV_PKT_FLAG_KEY))
          printf("picture type: '%c'\n",

 .. which prints out:

          picture type 'P'

 Perhaps my layman's understanding of video is wrong, but doesn't "key
 frame" == 'I' frame? Is this output valid?

 Confirming with:
          ffprobe -show_frames sample.mpg

              ... snip ...
              ... snip ...
              ... snip ...

 Am I missing something?

 How to reproduce:
 % run avcodec_decode_video2() for a while until you hit a keyframe packet
 and then perform the sanity check
 ffmpeg version 1.0 (also confirmed on trunk with 'git checkout master'
 built on Ubuntu Linux 12.04
 Patches should be submitted to the ffmpeg-devel mailing list and not this
 bug tracker.

Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2074>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list