[Libav-user] How to know if lavf guessed the duration from the bitrate or not?

Michael Niedermayer michaelni at gmx.at
Wed Jun 13 04:12:43 CEST 2012

On Tue, Jun 12, 2012 at 11:44:03AM -0600, Michael Bradshaw wrote:
> avformat_find_stream_info() attempts to find the file's and streams'
> durations, but it will guess them based on the bitrate if it can't
> determine the actual duration. This guess can be useful, but I need to
> be able to know if the AVFormatContext's or AVStream's duration was a
> guess   based on the bitrate or not, so I know how much I should trust
> this duration.
> Is there a way to know this?

One could parse the av_log() output other then that, i dont think
theres a way thats not quite fragile currently.

One thing that could be done is extending the API with  a flag that
specifies the expected accuracy of the duration field


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120613/1c72bba1/attachment.asc>

More information about the Libav-user mailing list