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

Michael Bradshaw mbradshaw at sorensonmedia.com
Thu Jul 19 22:01:55 CEST 2012


On Thu, Jul 19, 2012 at 1:16 PM, Don Moir <donmoir at comcast.net> wrote:
>[...]
> I did some visual inspection seeking here and there with my own app and the
> above file does not seem to be a problem. When I get a chance I will look at
> the numbers to check the accuracy. Just doing the visual inspection may not
> be enough.

I guess we should define what would be considered "erroneous" seeking
to make sure I'm on the same page as everyone, as it's possible I'm
not. Would these be considered "problematic:"

1) Seek is performed, first packet out of av_read_frame() has .flags=0
(meaning not a keyframe)
2) Seek is performed, avcodec_decode_video2() must be fed several
packets (57 in my test with ffmpeg command line, with #55 being the
only one with .flags=1 (keyframe)) before it gets a full frame out

I think those are the primary points that I want to make sure I'm
expecting the right behavior on.

Thanks,

Michael


More information about the Libav-user mailing list