[Ffmpeg-devel] Decoding a single MPEG2 GOP, missing 2 frames?
leon jorgunsen
leon.jorgunsen
Sat May 28 15:53:38 CEST 2005
Dear Bob and Mean,
You may have a look at the GOP header semantics section of the MPEG-2 Video specification.
The closed_gop flag of the GOP header indicates if you can decode correctly the B frames belonging to the previous GOP.
In your case Bob, this flag is probably set to 0.
--Leon
> De: Mean <fixounet at free.fr>
> A: FFMpeg development discussions and patches <ffmpeg-devel at mplayerhq.hu>
> Objet: Re: [Ffmpeg-devel] Decoding a single MPEG2 GOP, missing 2 frames?
> Date: Fri, 27 May 2005 13:34:10 +0000
> Robert Ficklin wrote:
>
> >Greetings,
> >
> >
> >I'm trying to decode the frames from a single GOP from an MPEG2 stream.
> >My intent is to be able to randomly seek to any GOP in a file (I have
> >an index of all I-frames in the file), and decode the entire GOP, one
> >frame at a time. The GOP size is 15, but what I see is the first 3
> >frames swallowed by avcodec_decode_frame without producing an output
> >image, the next 12 frames produce good images, and the
> >avcodec_decode_frame function gives me one more image when I pass it
> >NULL for the last input packet. Total usuable frames = 13. The next
> >random GOP I try to decode gives me an error about zombie frame being
> >dropped and produces
> >only 13 frames also.
> >
> >
> >I use av_seek_frame(..AVSEEK_FLAG_BYTE) to position the input file to
> >the desired GOP. Then av_read_frame to get each frame in the GOP, and
> >finally avcodec_decode_frame to get each frame image. I'm also using
> >the CVS snapshot from May 26.
> >
> >
> >
> My HO,
> The 2 first B frames belong logically to the previous gop and are discarded
> and the last 2 bframes are in next gop
>
>
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> <a href=http://mplayerhq.hu/mailman/listinfo/ffmpeg-devel>http://mplayerhq.hu/mailman/listinfo/ffmpeg-devel</a>
Protek-on: CaraMail met en oeuvre un nouveau Concept de S?curit? Globale - www.caramail.com
More information about the ffmpeg-devel
mailing list