[Ffmpeg-devel] Re: [Ffmpeg-cvslog] r8197 - in trunk/libavcodec: avcodec.h h264.c

Carl Eugen Hoyos cehoyos
Sat Mar 3 01:59:53 CET 2007

Hi Michael!

> > This would fix h264 over rtsp (no AVParser needed anymore), but

I forgot to add "for mplayer" - sorry!

> > unfortunately, there are framerate problems:
> > If the frame is truncated in 4 NAL units, video framerate is only 1/4=-(

(Somehow) fixed with -correct-pts, which OTOH leads to a constant AV-desync and
brakes my upcoming seek patch.

> > And a question: How do I send flags2 to decoder (I just commented the
> > check away)?

I added
((AVCodecContext*)sh_video->context)->flags2 |= CODEC_FLAG2_CHUNKS;
to the demuxer (on every frame!) which did not work, while
avctx->flags2 |= CODEC_FLAG2_CHUNKS;
in line 8271 of h264.c works - am I just tired, or shouldn't this be the same?

> well there are many many things to consider :(
> 1. isnt it better if the rtsp code sends complete frames? if a single
> NAL unit is delayed so it is received in the middle of the next frame
> things will not look good ...
> 2. why not just leave the AVParset there ...

Because it needs a few memcopy's?

> 3. you could improve the single NAL unit code and make it default
> that would need supporting the case that the first and last slice is
> lost this currently will not work, of course this should ideally be
> fixed anyway ...
> now about the framerate issue, i dunno the rtsp code but this sounds
> like it doesnt set dts/pts at all or only randomly so that lavf
> is filling things in and lavf assumes 1packet==1frame

As said, it's probably mplayers code that changes pts - sorry for the noise.

Thank you for your comments, I will resend my (updated) patch for h264 over rtsp
with AVParser to mplayer-devel.

Carl Eugen

More information about the ffmpeg-devel mailing list