<div dir="ltr">You select forwards or backwards based on the desired outcome of where you want to land in the file (just past or just before the desired seek position). backwards will land you just before (or at) the seek position. forwards will land you just after. It makes since if you consider that there is no foreknowledge of whether a given frame is present as a keyframe--that can only be discovered by overshooting, unless you do the messy business of actually decoding frames, which would make for a terrible seek indeed.<div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 12, 2019 at 3:25 PM Mark McKay <<a href="mailto:mark@kitfox.com">mark@kitfox.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<pre>I have an <span style="color:rgb(128,0,128)">AVFormatContext</span> that I need to seek in.  I've been using <span style="color:rgb(0,103,124)">av_seek_frame</span>(), but so far have not been passing the AVSEEK_FLAG_BACKWARD flag because I don't know how to figure out whether I need to seek forward or backwards.  Is there a way to query this from the AVFormatContext?<br><br>Mark</pre>
</div>_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="https://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">https://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br>
To unsubscribe, visit link above, or email<br>
<a href="mailto:libav-user-request@ffmpeg.org" target="_blank">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".</blockquote></div>