[Libav-user] Byte based seeking

Arthur Emídio arthur.500 at gmail.com
Tue Aug 22 00:15:26 EEST 2017


What is the best approach to perform byte seeking when seek via timestamp
(by using av_seek_frame()) is not available?

In my case, it is feasible to preprocess the input video by iterating
through all AVFrames. I read that av_seek_frame() with AVSEEK_FLAG_BYTE
doesn't always work.

I tried to use the approach described in [1] using avio_seek() but I did
not succeed, I populated a (timestamp -> byte) map, such that "byte" is the
byte offset of the last read key frame while preprocessing the video. The
frame that I obtain after performing the seek comes way before the target,
and there are lots of key frames between them.

[1]: https://stackoverflow.com/a/3062994/351527

Thank you.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20170821/b1404fc7/attachment.html>

More information about the Libav-user mailing list