<div dir="ltr">I am trying to decode a live stream using the libav libraries from ffmpeg.<div>I open a udp input using avformat_open_input.</div><div>I get the stream information and open_codec_contexts for the video and audio streams.</div><div>Then when everything is setup I go through a loop of </div><div>av_read_frame</div><div>decode_packet</div><div>av_packet_unref</div><div><br></div><div>This is all from the demux decode example that comes with ffmpeg source code.</div><div><br></div><div>However, in decode packet I have updated it to push the decoded frame to memory location and then some dedicated firmware copies it from that to a frame buffer to display on the HDMI output (this is on an embedded system).</div><div><br></div><div>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.</div><div><br></div><div>Is there a means of determining how full the buffer is?</div><div><br></div><div>Regards,</div><div>Simon</div></div>