[FFmpeg-devel] About guess_correct_pts / AVFrame.best_effort_timestamp
Alexander Strange
astrange
Thu Feb 17 00:23:37 CET 2011
On Feb 16, 2011, at 6:01 PM, Alexander Strange wrote:
>
> On Feb 16, 2011, at 11:28 AM, M?ns Rullg?rd wrote:
>
>> Nicolas George <nicolas.george at normalesup.org> writes:
>>
>>> L'octidi 28 pluvi?se, an CCXIX, M?ns Rullg?rd a ?crit :
>>>> ??? = frame.pkt_pts
>>>
>>> AV_NOPTS_VALUE if the input format is AVI. This is not acceptable. Please
>>> try again.
>>
>> AVI doesn't have timestamps, so the first decoded frame has PTS 0, and
>> the following ones increment it by 1/framerate. Simple.
>
> All kinds of formats commonly believed to be CFR are not CFR.
> This includes avi, which only has monotone times (= DTS) but also has dropped frames, which lavf very reasonably outputs as VFR.
>
> I don't have a sample less than 300MB, but some can be generated by:
>
> mencoder -ofps 120000:1001 -vf pullup -o out.avi <a mixed 30fps/24fps MPEG file>
>
> or by asking any Japanese person for 120fps files.
>
> It also won't work with, say, h264 ES, because PAFF means some of the output CFR frames use different numbers of packets. So the 1/framerate times need to be assigned after decoding... and this is the place to do it.
Note about this part: they could still be assigned before decoding, if the AVParser can combine the packets into one-packet-per-frame. But in practice, we have a lot of unimplemented AVParser functionality (I don't remember the details here), and it would make decoding slightly slower due to more memcpy.
More information about the ffmpeg-devel
mailing list