<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><span></span></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div><br>Le 9 déc. 2014 à 11:00, Vadim Fedorov <<a href="mailto:coderiks@gmail.com">coderiks@gmail.com</a>> a écrit :<br><br></div><blockquote type="cite"><div><div dir="ltr">Hi,<div><br></div><div>Not really, because your 100th frame depends on the 99th frame (or maybe on 98th), but not directly on the 1st one. However, indirectly it is still depends on the key frame, because 99th depends on 98th and so on. This means that to get your 100th frame you should start from the key frame and decode all 98 frames in between.</div></div></div></blockquote><blockquote type="cite"><div><div dir="ltr"><div><br></div><div>Best regards,</div><div>Vadim </div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-12-09 10:30 GMT+01:00 YIRAN LI <span dir="ltr"><<a href="mailto:mrfun.china@gmail.com" target="_blank">mrfun.china@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5"><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><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><font color="#888888"><div><br></div></font></span></div></blockquote><div><br></div></div></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></div></div></blockquote></div></div></div></blockquote><div><br></div><div>Not sure I got the situation. As soon as you start skipping packets, you are not guaranteed to have correct content until you reach the next key frame. </div><br><blockquote type="cite"><div><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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><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><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" target="_blank">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>
<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><br clear="all"><div><br></div>-- <br><div class="gmail_signature">С уважением,<div>Вадим Фёдоров</div></div>
</div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Libav-user mailing list</span><br><span><a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a></span><br><span><a href="http://ffmpeg.org/mailman/listinfo/libav-user">http://ffmpeg.org/mailman/listinfo/libav-user</a></span><br></div></blockquote></div></body></html>