[Libav-user] How to precisely seek in an audio file

Anton Shekhovtsov shekh.anton at gmail.com
Fri Oct 26 18:51:22 EEST 2018


>
> Hello,
>
> Thank you for your help.
>
> That said, I'm only dealing with audio file (ogg and mp3), no video at all.
> And my goal is to set the current position to, let say, 27994.717
> milliseconds (well, as close as possible, if possible with an error margin
> below 1 millisecond), and start audio extraction from this very position
> (as I do in my code example
> <https://gist.github.com/mregnauld/2538d98308ad57eb75cfcd36aab5099a>).
>
> So what is the right way to achieve that? Is there any tutorial or example
> somewhere?
>
> Thanks.
>
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user


There is a lot of useful info in headers, check it.
I think in your case this is what you need to use:
-do not specify stream index
-do not specify any flags
-position is in AV_TIME_BASE units which is ns if I remember correctly.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20181026/8627afbb/attachment.html>


More information about the Libav-user mailing list