[FFmpeg-devel] [PATCH] avformat: add skip_estimate_duration_from_pts

Michael Niedermayer michael at niedermayer.cc
Wed May 16 23:13:56 EEST 2018

On Tue, May 15, 2018 at 04:06:24PM -0700, Aman Gupta wrote:
> From: Aman Gupta <aman at tmm1.net>
> For seekable mpegts streams, duration is calculated from
> pts by seeking to the end of the file for a pts and subtracting
> the initial pts to compute a duration.
> This can be expensive in terms of added latency during
> probe, especially when streaming over a network. This new
> option lets you skip the duration calculation, which is useful
> when you don't care about the value and want to save some overhead.
> This patch is particularly useful when dealing with live mpegts
> streams. Normally such streams are not seekable, so durations
> are not calculated. However in my case I am dealing with a seekable
> live mpegts stream (networked access to a .ts file which is still
> being appended to).
> Signed-off-by: Aman Gupta <aman at tmm1.net>
> ---
>  libavformat/avformat.h      | 7 +++++++
>  libavformat/options_table.h | 1 +
>  libavformat/utils.c         | 6 ++++++
>  3 files changed, 14 insertions(+)


it may make sense to design a more generic system in the future
where the user can specify what fields she needs (like duration) which fields
she could use and which are completely useless.


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180516/54081820/attachment.sig>

More information about the ffmpeg-devel mailing list