[FFmpeg-devel] Thirdparty codec integration.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Thu Mar 24 16:58:13 CET 2016

On Thu, Mar 24, 2016 at 08:35:19PM +0530, Suresh Kumar wrote:
> Hello,
> Currently i am integrating a third party video decoder to FFMPEG.
> I have an issue with my decoder. As it is giving multiple output frames for
> single packet/frame.
> I have tried the possible scenarios
> 1. If i return the decode function immediately(with consumed bytes) after
> getting the output frame with "got_frame" to 1. For the next decode call
> its getting new packet to decode. But previous packet is not decoded
> fully.(which is lost).

Haven't worked on that kind of thing in a long time, but I believe
you should just return 0 from the decode function to indicate you
were not able to consume the input buffer.
You should then be presented with the same packet in the next decode.
I.e. you should be able to "stall" the input by returning 0, allowing
you to produce additional outputs.

More information about the ffmpeg-devel mailing list