[Libav-user] Force avcodec_receive_packet to return packet
bilananton at gmail.com
Sat Feb 20 09:58:52 EET 2021
I am encoding intra only mpeg1video using FFmpeg api and I would like to
get packets out of the encoder without delay starting from the very first
frame, but I get AVERROR(EAGAIN) from avcodec_receive_packet. I read this:
At the beginning of decoding or encoding, the codec might accept multiple
input frames/packets without returning a frame, until its internal buffers
Is there a way to remedy this e.g. may be by changing internal buffer size ?
I have read about avcodec_flush_buffers but alas mpeg1video encoder does
not have AV_CODEC_CAP_ENCODER_FLUSH.
If there is no either way what would be better: to send null frame to the
encoder and recreate context each frame or to send the same frame twice and
then discard it ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libav-user