[FFmpeg-devel] About guess_correct_pts / AVFrame.best_effort_timestamp

Luca Barbato lu_zero
Thu Feb 17 20:28:15 CET 2011

On 02/17/2011 08:06 PM, Nicolas George wrote:
> Le nonidi 29 pluvi?se, an CCXIX, Luca Barbato a ?crit :
>> how many could be addressed having the demuxer call in parsers for help?
> Having the demuxer call in parsers for help means that lavc can only work
> with lavf or a demuxer at least as smart as lavf.
> Do you consider that acceptable?

I assume that the decoder can trust what it gets from the demuxer,
what's wrong with that assumption?

> As for myself, I would consider it a really bad idea.

Why? The decoder doesn't have enough knowledge to decide.

> I agree. But that does say much about what lavc must work with.


> Looking at the AVPacket structure, and considering the quirks of various
> format, assuming a stupid (but correct) demuxer, the information that comes
> to lavc as input is made of any subset of:
> 	- a packet PTS;
> 	- a packet DTS;
> 	- a packet duration;
> 	- possibly some global information (framerate, maybe).
> With that, and the help of the packet reordering mechanism, lavc (or
> possibly something called from lavc, but since the packet reordering is
> needed, I do not see the point) should try to determine the frame PTS at
> best as it can.

what the decoder should do is decode and possibly make easy for the
caller know which is the mapping between the input packets and the
output packets and that's all.

Code to provide hints about the right timestamp should be something
optional since we don't know what the caller would trust better.

> (By the way, is there a reason not to reorder pkt_duration like pkt_pts?)




Luca Barbato

More information about the ffmpeg-devel mailing list