The solution was simple. Only needed to add the flag AV_CODEC_CAP_DELAY[1] to the decoder to enable the draining condition. [1]: https://ffmpeg.org/doxygen/trunk/group__lavc__core.html#ga3f55f5bcfbb12e06c7cb1195028855e6 ---- Regards, Anamitra