[MPlayer-users] Problems with h.264 and lavf demuxer (paff/mbaff?)

Marco Munderloh munderl at tnt.uni-hannover.de
Wed Mar 5 17:37:33 CET 2014

> I played the video you provided with -demuxer mpegts and
> whenever I seek back to the beginning, I see one or two
> broken frames before the first keyframe.

Yeah, that's true but no problem.

>> But if I use the lavf demuxer, the first GOPs are totally
>> broken until the next IDR frame arrives.
> This is to some degree the expected behaviour, use
> "-lavdopts wait_keyframe" if you don't like it.

That is not what I meant. The mpegts demuxer plays fine
from the _first_ IDR frame, lavf plays broken frames until
the _second_ IDR frame arrives (or just starts playing
from the second IDR frame). So there is more than half
a second video missing. I seems to me that some NALUs
got lost in the demuxer and the decoder gets confused?
Mabye a reference frame got lost, at least that 's
what I'm guessing from the libavcodec output.

>> ffmpeg shows the same behavior on transcoding
>> as the mplayer lavf demuxer;
> I tested the following:
> $ ffmpeg -i DVB_testvideo.ts -qscale 2 out.avi
> out.avi does not show broken initial frames.
> (You can use -flags2 +showall to get the MPlayer
> behaviour, but this apparently is not what you want.)
> If it does something else for you, please consider
> reporting it, it would be a bug (possible regression).

I prefer the behavior of playing from the first complete
IDR available and skip the undefined frames in the beginning,
so I'm totally okay with this. Problem is, the first IDR
(or PPS/SPS) gets lost in the demuxer somehow (just guessing here)
so playing starts at second IDR frame and more than half a
second of video gets lost (or broken frames are played).


More information about the MPlayer-users mailing list