[FFmpeg-devel] h264: dealing with "broken links"

Mark Buechler mark.buechler
Mon Nov 19 19:39:27 CET 2007


How could this best be handled? Ignore non-IDR I frames until an IDR slice
is found? Would that prevent B frames from being allocated needlessly?

- Mark.

On 11/18/07, Michael Niedermayer <michaelni at gmx.at> wrote:
>
> On Sun, Nov 18, 2007 at 11:48:43PM +0100, Reinhard Nissl wrote:
> > Hi,
> >
> > in the thread "[PATCH] Enable PAFF decoding", Loren Merritt wrote, that
> > H.264's "closed gop" implementation are IDR slices. When I start
> > replaying a VDR recording at an I frame which is coded with IDR slices,
> > I can successfully watch the recording.
> >
> > But I've got some samples from Russia which contain very few IDR coded I
> > frames so, most often replay starts at an I frame which was coded with
> > non IDR slices. But in that case, FFmpeg decodes the I frame properly
> > but then runs out of frames when dealing with the B frame.
> >
> > It reports [h264 @ 0xb61bb2f0]warning: first frame is no keyframe
> > and then gotos to a location in MPV_frame_start() where it allocates a
> > further frame. This "loop" continues until all 32 frames are allocated,
> > where replay terminates with an error.
> >
> > A debug version would have asserted before entering the loop:
> >
> > assert(s->pict_type != B_TYPE); //these should have been dropped if we
> > don't have a reference
> >
> > But I'm a bit pointless where this should have been done. Attached is a
> > hack which patches pict_type to P_TYPE in that case, which makes the
> > sample play properly. As I do not get any errors regarding picture
> > referencing, I think it is legal to try to replay "broken links"
> > although they do not start with IDR slices.
>
> patch rejected, as the text says b frames should be droped if a reference
> is missing
> and changing pict_type to in invalid value is never acceptable
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> I am the wisest man alive, for I know one thing, and that is that I know
> nothing. -- Socrates
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFHQPPtYR7HhwQLD6sRAiPEAJ9SzGkZ+sFHyyEqU00+APXkaJPFWACfXlU+
> aWzSQofqxQO166xxxZSb7Oo=
> =fpqg
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>




More information about the ffmpeg-devel mailing list