[Libav-user] Decoding with limited CPU power
Simon Brown
simon.k.brown at gmail.com
Fri Apr 17 15:31:15 EEST 2020
I am trying to decode a live stream using the libav libraries from ffmpeg.
I open a udp input using avformat_open_input.
I get the stream information and open_codec_contexts for the video and
audio streams.
Then when everything is setup I go through a loop of
av_read_frame
decode_packet
av_packet_unref
This is all from the demux decode example that comes with ffmpeg source
code.
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).
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?
Regards,
Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20200417/805b525e/attachment.html>
More information about the Libav-user
mailing list