[Libav-user] Exact duration of Audio/Video file!

thanh nhan thanh nhan nhanndt_87 at yahoo.com
Thu Nov 14 09:40:54 CET 2013


Dear everyone,
I tried to get duration (in second) of audio/video file using AVStream like this:
int64_t duration = (stream->duration*stream->time_base.num)/stream->time_base.den;
however, i sometimes got wrong information (commonly greater than real duration). As i  guess the stream->duration provides the wrong value.
Could anybody suggest me another way to exactly get duration or how to verify the correct duration?
Thank you very much
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20131114/48f5a400/attachment.html>


More information about the Libav-user mailing list