[FFmpeg-devel] Key Frame Marking

Michael Niedermayer michaelni
Fri Oct 12 11:05:03 CEST 2007


On Thu, Oct 11, 2007 at 11:35:57PM -0400, Jeff Downs wrote:
> compute_pkt_fields in libavformat/utils.c sets an outgoing AVPacket's 
> flags to contain the key frame flag if either the stream codec is intra 
> only (~line 650) or if the stream's parser indicates that the current 
> picture type is FF_I_TYPE (~line 729).
> Problem is if a codec is both intra only and uses a parser that doesn't 
> set ParserContext.pict_type. Because a parser is in use, the packet flags 
> are cleared at the end of compute_pkt_fields. Keyframe flag is not 
> restored because pict_type is always 0.
> Case in point here is mjpeg.  Packets from mjpeg streams (in my case, 
> inside AVI) never get the keyframe flag set due to this. There may be 
> other codecs like this; I didn't check.
> The attached patch moves the setting of key frame flag based on intra-only 
> codec to the end of compute_pkt_fields and gives it priority over looking 
> at the parser since any outgoing frame for intra only codec should have 
> keyframe set.

ok if it passes regression tests

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071012/8a87cc7a/attachment.pgp>

More information about the ffmpeg-devel mailing list