<br><br><div class="gmail_quote">On Thu, Jul 19, 2012 at 9:25 AM, Carl Eugen Hoyos <span dir="ltr"><<a href="mailto:cehoyos@ag.or.at" target="_blank">cehoyos@ag.or.at</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So if the file is ~2GB and (as a user) I seek approximately to<br>
the middle of the video and decide to seek back then, the<br>
video should be decoded from the beginning to find the keyframe<br>
before the position I want to seek to?<br>
(I am just trying to find out if I am correct in my believe that<br>
it is not generally possible / useful to seek to the latest<br>
keyframe before the requested position, but that the only<br>
realistic approach is to seek to the nearest keyframe at or later<br>
than requested.)<br></blockquote></div><br>You don't need to decode to find keyframes, this is what the codec parsers are meant to determine.<br>You also don't need to start from the beginning of the file, you can jump a pre-determined amount before time X and look for a keyframe, if none is found jump back a bit more, etc.<br>
Ignoring the special case of intra-refresh H264 streams which do not have real key-frames (and maybe other formats with similar mechanics), this should work.<br>