On Thu, Jul 19, 2012 at 9:25 AM, Carl Eugen Hoyos <ceho...@ag.or.at> wrote:
> So if the file is ~2GB and (as a user) I seek approximately to > the middle of the video and decide to seek back then, the > video should be decoded from the beginning to find the keyframe > before the position I want to seek to? > (I am just trying to find out if I am correct in my believe that > it is not generally possible / useful to seek to the latest > keyframe before the requested position, but that the only > realistic approach is to seek to the nearest keyframe at or later > than requested.) > You don't need to decode to find keyframes, this is what the codec parsers are meant to determine. 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. 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.
_______________________________________________ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user