[Libav-user] Decoding with limited CPU power

Devin Heitmueller dheitmueller at kernellabs.com
Fri Apr 17 15:53:36 EEST 2020

> My problem is that from time to time my decode or frame copying gets behind and if it gets too far behind I end up with a "circular buffer overrun" error and it bombs out.  What I want to be able to do is determine WHEN I'm getting behind in decoding and so take the option of dropping some frames to catch up.  I only have I and P frames in my stream, so as long as I don't drop an I frame I should be ok.  However, I don't see a way of determining how many frames are stored in the circular buffer and so whether I am behind or not.
> Is there a means of determining how full the buffer is?

Not through the standard APIs, as implementations of FIFOs within
input modules vary depending on the input.  In my case (which is the
UDP source), I added instrumentation to libavformat/udp.c which once a
second calls av_fifo_space(s->fifo) and reports it back to my
application.  This allows me to continuously track whether the FIFO is
getting backlogged (common if the pipeline is falling behind
realtime), and take action before hitting the overflow condition.


Devin J. Heitmueller - Kernel Labs

More information about the Libav-user mailing list