<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Le 11 avr. 2014 à 11:20, Mert Gedik <<a href="mailto:gedikmert89@gmail.com">gedikmert89@gmail.com</a>> a écrit :<br><div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hello everyone,<div><br></div><div style="">I want to show how much data is downloaded in my player, and I did as below,</div><div style=""><br></div><div style=""><div style="margin: 0px; font-size: 11px; font-family: Menlo;">
<span style="color:rgb(187,44,162)">if</span> (packet.<span style="color:rgb(79,129,135)">data</span>) {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"> <span style="color:rgb(79,129,135)">totalBytes</span> += packet.<span style="color:rgb(79,129,135)">size</span>;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"> <span style="color:rgb(49,89,93)">av_free_packet</span>(&packet);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"> }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><div style="margin: 0px;">in a loop that uses<font face="Menlo"><span style="font-size:11px"> </span></font><span style="font-family:Menlo;font-size:11px;color:rgb(49,89,93)">av_read_frame</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><span style="color:rgb(49,89,93)"><br></span></div>How ever, when I tested a video file that I know the size of the video file, I see that totalBytes is always lower than the file size. How can I calculate the exact value ?<br>
<br><br>Thanks,<br><br><br>-MG</div></div></blockquote><br></div><div>You are computing the size of the data for the video stream only. The video file also contains data for the container format required by the demuxer. Except if you use raw streams, which is usually not the case.</div><div><br></div><div>Lucas</div></body></html>