<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>Le 9 déc. 2014 à 08:12, YIRAN LI <<a href="mailto:mrfun.china@gmail.com" target="_blank">mrfun.china@gmail.com</a>> a écrit :</div><div><div class="h5"><br><div><div dir="ltr"><div style="font-family:georgia,serif">Hi, </div><div style="font-family:georgia,serif"><br></div><div style="font-family:georgia,serif">I have a question about read frame,</div><div style="font-family:georgia,serif"><br></div><div style="font-family:georgia,serif">Suppose I've just opened a file, so the readpointer is at the beginning of the file.</div><div style="font-family:georgia,serif"><br></div><div style="font-family:georgia,serif">Compare these two methods:</div><div style="font-family:georgia,serif"><br></div><div style="font-family:georgia,serif">1. call av_read_frame + avcode_decode_video2 to decode 100 video packets( suppose each packet can decode into a frame)</div><div style="font-family:georgia,serif">2. call av_read_frame, but only decode the 100th packet (all previous 99 packets are just discarded)</div><div style="font-family:georgia,serif"><br></div><div style="font-family:georgia,serif">Will the 100th frame from method 1 and the frame from method 2 have same content, timestamp, etc?</div><div style="font-family:georgia,serif"><br></div><div style="font-family:georgia,serif">Thanks</div></div></div></div></div></blockquote><br></div><div>Hi,</div><div><br></div><div>Decoding the 100th packet alone can be equivalent in both situations only if this packet is a keyframe. If not, FFmpeg will need all the packets up to the first preceding key frame in order to be able to give you a frame with correct content. I'm unsure whether other metadata like timestamp depend on the method (although I don't think so).</div><span class="HOEnZb"><font color="#888888"><div><br></div></font></span></div></blockquote><div><br></div><div class="gmail_default" style="font-family:georgia,serif">​Thanks Lucas,</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif">Let's assume both 2 methods start reading from a key packet. and the next key is in the 200th packet.</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif">So you mean continuously decoding to 100th frame has same result as skip 99 and decode 100th alone?</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif">​</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class="HOEnZb"><font color="#888888"><div></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>