[Ffmpeg-devel] problem decoding frames when first frame is B
Mon Apr 23 23:54:42 CEST 2007
2007/4/20, rkmr.em at gmail.com <rkmr.em at gmail.com>:
> On 4/20/07, M?ns Rullg?rd <mans at mansr.com> wrote:
> > "rkmr.em at gmail.com" <rkmr.em at gmail.com> writes:
> > > I have a valid MPEG-2 video stream in which the first two frames are
> > > B-frames. ffmpeg is not able to decode those two frames:
> > >
> > > avcodec_decode_video( m_vDec, m_decodedPicture,
> > > &got_picture, (uint8_t*) samplePtr, sampleLength );
> > >
> > > got_picture is 0 for the first two frames. Is this a know problem?
> > Upload a sample, please.
> can you tell how to do this? it is a 49MB file.
MPlayer and FFmpeg are using same server and they share same ftp.
However if I understand your question correctly, I must say that this
behavior is deliberate and correct.
You can look at iso13818-2 chapter 18.104.22.168 where it says that first
coded frame shell not be B-frame. This means your input is NOT valid
Now even if we want to support it, there is no way to know that
B-frame doesn't need both future and past reference frames. This could
be know only if we decode all blocks. The mere type indicates that it
needs both references.
There is possible solution to this problem. Instead of dropping these
frames we could allocate black reference frames. In this case somebody
else would come and ask "Why I see 2 broken frames with a lot of black
blocks in them?"
At the moment ffmpeg12 doesn't honor broken_link flag (that indicates
open GOP), maybe I'll try to make proper handling sometime soon.
More information about the ffmpeg-devel