<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 11, 2014 at 1:11 PM, Lucas Soltic <span dir="ltr"><<a href="mailto:lucas.soltic@orange.fr" target="_blank">lucas.soltic@orange.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Le 11 avr. 2014 à 11:20, Mert Gedik <<a href="mailto:gedikmert89@gmail.com" target="_blank">gedikmert89@gmail.com</a>> a écrit :<div>
<div class="h5"><br><div><br><blockquote type="cite"><div dir="ltr">Hello everyone,<div><br></div><div>I want to show how much data is downloaded in my player, and I did as below,</div><div><br></div><div><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></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>
<span class="HOEnZb"><font color="#888888"><div><br></div><div>Lucas</div></font></span></div><br>_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br></blockquote></div><br></div><div class="gmail_extra"><br></div><div class="gmail_extra" style>Thanks lucas for the information but </div><div class="gmail_extra" style>how can I get the size of data for the container format required by the demuxer ?</div>
<div class="gmail_extra" style><br></div><div class="gmail_extra" style>Also, I realized that the difference between video file size and my calculation gets higher when the video file size is bigger.</div><div class="gmail_extra" style>
<br></div><div class="gmail_extra" style>any help is appreciated,</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>-MG</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>
<br></div><div class="gmail_extra" style><br></div><div class="gmail_extra"><br></div></div>