[FFmpeg-devel] About guess_correct_pts / AVFrame.best_effort_timestamp

Måns Rullgård mans
Wed Feb 16 17:37:36 CET 2011

"Ronald S. Bultje" <rsbultje at gmail.com> writes:

> Hi,
> 2011/2/16 M?ns Rullg?rd <mans at mansr.com>:
>> Nicolas George <nicolas.george at normalesup.org> writes:
>>> L'octidi 28 pluvi?se, an CCXIX, M?ns Rullg?rd a ?crit?:
>>>> AVI doesn't have timestamps, so the first decoded frame has PTS 0, and
>>>> the following ones increment it by 1/framerate. ?Simple.
>>> Are you saying that Mr X should put a special case in his code for AVI?
>> No, he should put a special case for no PTS on an input frame:
>> pts = frame.pkt_pts != AV_NOPTS_VALUE? frame.pkt_pts : prev_pts + 1/framerate;
>> prev_pts = pts;
>> This code will always work.
> This code could be in lavf av_read_frame() even.

It could, but it would need to duplicate the frame reordering from the
decoder to work out the PTS.  It is simpler to do this after decoding,
or in place of decoding in the stream copy case.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list