[FFmpeg-devel] [PATCH v2 1/2] avformat: add AVFormatContext.first_pkt_wallclock

Gyan Doshi ffmpeg at gyani.pro
Tue Jun 28 11:35:48 EEST 2022



On 2022-06-28 01:20 pm, Andreas Rheinhardt wrote:
> Gyan Doshi:
>>
>> On 2022-06-28 10:43 am, Anton Khirnov wrote:
>>> Quoting Gyan Doshi (2022-06-25 10:29:50)
>>>> Stores wallclock time for the first packet received.
>>>> Used for crude sync offset among inputs.
>>>> ---
>>>>    doc/APIchanges         |  3 +++
>>>>    libavformat/avformat.h | 10 ++++++++++
>>>>    libavformat/demux.c    |  3 +++
>>>>    libavformat/options.c  |  1 +
>>>>    libavformat/version.h  |  2 +-
>>>>    5 files changed, 18 insertions(+), 1 deletion(-)
>>> Why should this be in the library? Seems to me this can be just as
>>> easily done by the callers who need it.
>> To not add some extra latency,  just like how
>> `use_wallclock_as_timestamps` was implemented inside lavf.
>>
> Why don't you use use_wallclock_as_timestamps and offset the timestamps
> by the lowest returned timestamp?

Because that will destroy the original inter-packet timing intervals. 
Those we usually wish to keep, especially for B-frames which are stored 
out of presentation order.

Regards,
Gyan


More information about the ffmpeg-devel mailing list