[Libav-user] Why does av_seek_frame() not seek to a keyframe?

Hendrik Leppkes h.leppkes at gmail.com
Thu Jul 19 08:25:10 CEST 2012

On Thu, Jul 19, 2012 at 8:18 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> Michael Bradshaw <mbradshaw at ...> writes:
> > But when I seek, the first packet returned out of the demuxer is
> > not a keyframe packet, and I have to read several (~45ish) packets
> > until I encounter a keyframe.
> Could you provide a sample that does not seek to a keyframe with
> ffmpeg -ss x -i input out.png
> (I tested this yesterday on random mpeg2video samples and afaict,
> it did work.)
This test is somewhat meaningless because it'll skip non-keyframes in the
decoder until it finds one.
But the idea is to ensure that you can decode as of time X, which means you
need to seek to the last keyframe *before* time X, which is something that
is not supported currently.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120719/8ef82119/attachment.html>

More information about the Libav-user mailing list