[FFmpeg-devel] About guess_correct_pts / AVFrame.best_effort_timestamp

Luca Barbato lu_zero
Fri Feb 18 08:13:05 CET 2011

On 02/18/2011 05:53 AM, Alexander Strange wrote:
> What side effects?

broken playing and transcoding on certain h264 in mpegts is one of them
I noticed recently ^^;

> I saw nothing in this thread except questions about how libavformat works,
> all concrete proposals for client code were wrong.

> I think more valid times _could_ be made to work in libavformat, with better
> AVParsers that don't quite exist, but that would leave something like this:
> avcodec_decode_video(..)
> pts = avctx->pkt_pts ? avctx->pkt_pts : avctx->pkt_dts;

> Even this one line deserves to be moved into lavc, since the fact that ffplay/ffmpeg were wrong for 5+ years means nobody can be expected to get it right.

Why it shouldn't moved in another function, provided by libavformat
possibly covering all the heuristic so you *can* use it to get the pts
but you can do w/out if you know what are you doing?

pts = avformat_guess_pts(avctx, avfctx, ...);



Luca Barbato

More information about the ffmpeg-devel mailing list