[Libav-user] Audio stream seeking calculation

wm4 nfxjfg at googlemail.com
Sun Sep 21 16:37:39 CEST 2014


On Sun, 21 Sep 2014 20:00:26 +0530
Ankush <wadkes93 at gmail.com> wrote:

> Hi, 
> I am working with avseek_frame() using bytes. I figured out the calculation for the timestamp value of the video stream from the frame number but couldn't figure out a way to calculate the approriate timestamp for the audio stream from the sample number. Any help here could be really useful.
> 
> Thank you

That may be impossible. Just do timestamp seeks directly (and also use
AVSEEK_FLAG_BACKWARD).

That might be unreliable too (depending on the format), and the only
absolutely reliable way to do sample-exact seeking is decoding the file
from the start and skipping samples until you reached the target.


More information about the Libav-user mailing list