[FFmpeg-devel] [PATCH v4 0/1] avformat/mpegts: Add duration_probesize AVOption

Nicolas Gaullier nicolas.gaullier at cji.paris
Tue Mar 26 15:18:30 EET 2024


Thanks to Stefano for the precise inspection, I addressed all the points.

The question about what is specific to mpeg remains, so I will try to elaborate on this.
I don't see how duration_probesize could be needed in any way beyond estimate_timings_from_pts().
And it seems there is no other headerless format like mpeg's, byte seekable but especially dts-muxed, cbr-stuffinged with, potentially, a high I/O physical audio/video delay - or not.
It seems the probing of mpeg streams is very specific currently and I don't think this situation will change in the future.
Take mp4 kind formats: strictly index-based, and even for a truncated file (with moov at the head), no I/O is required to get the actual truncated stream durations.
Take mxf kind formats that can be streamed, or simply truncated/broken: the editunits are quite consistent, carrying both audio&video, so recovering the duration would not be very tricky.

This v4 is "an experimental try" to lift the AVOption in the demuxer (which mean no API change). The problem is that it makes the AVOption belong to mpegts.c (I will focus on mpegts, I think it is the only real use case) but unused by it, so I don't feel it is acceptable?
Any input welcome.

Nicolas Gaullier (1):
  avformat/mpegts: Add duration_probesize AVOption

 doc/demuxers.texi     |  13 +++++
 doc/formats.texi      |   2 +-
 libavformat/demux.c   |  23 ++++++---
 libavformat/mpegts.c  | 104 +---------------------------------------
 libavformat/mpegts.h  | 108 +++++++++++++++++++++++++++++++++++++++++-
 libavformat/version.h |   2 +-
 6 files changed, 140 insertions(+), 112 deletions(-)

-- 
2.30.2



More information about the ffmpeg-devel mailing list