[libav-api] start of a live stream

Florian Iragne florian at iragne.fr
Fri Aug 28 08:55:19 CEST 2015


I'm using libav to decode live audio streams and process them using 
custom code. In this process the start timestamp of the stream is quite 

Currently, i take the timestamp (using std::chrono) at the end of the 
first decoded packet (av_read_frame -> ... -> av_free_packet). Most of 
the time this is fine and i observe no or little difference between this 
start timestamp and the "reality".

In some cases, i observe huge differences (many seconds).

So, i wonder if i can be more precise in my timestamp choice.

Does libav starts buffering when i call avformat_open_input and keeps 
the buffers until i call av_read_frame? When does it really starts to 
read the stream?

Thanks for your advices


More information about the libav-api mailing list