[Libav-user] keyframe not a keyframe?

Michael R. Hines michael at hinespot.com
Fri Dec 28 19:08:51 CET 2012

I got a response from the ffmpeg bugtracker:


        I suspect your are missing the codec delay. The video frame you
        get out usually isn't based on the packet you just sent in at
        all. This is especially true with multithreaded decoding, but
        even without it's not generally possible due to how B-frames

And, indeed I print out the ->pict_type "picture type" 3 frames later,
there is an I-frame that pops up a few frames later with a "delay" of
sorts exactly a 3 frames later. In my case, I have a quad-core computer,
so perhaps there's a thread being allocated for each core on my computer
to do the encoding.

- Michael

On Wed, 2012-12-26 at 05:15 -0500, Michael R. Hines wrote:

> Hi,
> After decoding a packet containing AV_PKT_FLAG_KEY in the flags,
> I was expecting to get I-frames, but instead I got P-frames:
> The following statement:
> 	printf("packet flags: %d picture type: %c\n", inPacket.flags,
> 		av_get_picture_type_char(frame->pict_type));
> Returns the output:
> 	packet flags: 1 picture type: P
> When I was expecting:
> 	packet flags: 1 picture type: I
> Where '1' == AV_PKT_FLAG_KEY.
> Is this behavior correct? (I'm decoding MPEG2 video).
> Thanks,
> - Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20121228/da2ff037/attachment.html>

More information about the Libav-user mailing list