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

Roger Pack rogerdpack2 at gmail.com
Thu Aug 2 20:48:51 CEST 2012

> I believe that does no seeking there. Putting -ss after the input will cause
> ffmpeg to demux up to the requested timestamp, so it's not quite related to
> seeking (putting -ss before the input will seek the input file).
> Since -a/vcoded copy avoids re-encoding, it just copies the packets (without
> regard to keyframes, iiuc). The packet closest to 90 seconds probably isn't
> a keyframe, but since that's where you requested the start it ffmpeg starts
> copying packets from there anyway.

Yes I would totally agree with you, except I can't find a single "-ss"
time that seems to "accidentally hit an i-frame" and work the way you
and I would expect it to...though I haven't looked into it much...

More information about the Libav-user mailing list