<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div>Dear everyone,</div><div>I tried to get duration (in second) of audio/video file using AVStream like this:</div><div><em><font face="Courier New, courier, monaco, monospace, sans-serif">int64_t duration = (stream->duration*stream->time_base.num)/stream->time_base.den;</font></em></div><div><font face="HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif">however, i sometimes got wrong information (commonly greater than real duration). As i  guess the <font face="Courier New"><em>stream->duration </em><font face="HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif">provides the wrong value.</font></font></font></div><div>Could anybody suggest me another way to exactly get duration or how to verify the correct
 duration?</div><div>Thank you very much</div></div></body></html>