[FFmpeg-devel] [PATCH] avcodec/v4l2_m2m_dec: dequeue frame if input isn't ready

Andriy Gelman andriy.gelman at gmail.com
Mon Dec 27 08:17:38 EET 2021


On Tue, 14. Dec 02:12, Cameron Gutman wrote:
> The V4L2M2M API operates asynchronously, so multiple packets can
> be enqueued before getting a batch of frames back. Since it was
> only possible to receive a frame by submitting another packet,
> there wasn't a way to drain those excess output frames from when
> avcodec_receive_frame() returned AVERROR(EAGAIN).
> 

> In my testing, this change reduced decode latency of a real-time
> 60 FPS H.264 stream by approximately 10x (200ms -> 20ms) on a
> Raspberry Pi 4.

I was doing some more tests today, but didn't have any luck dequeuing a frame
if ff_decode_get_packet() returned EAGAIN.
Could you share the dataset?

Thanks,
-- 
Andriy


More information about the ffmpeg-devel mailing list