[FFmpeg-devel] [PATCH] lavfi/vf_vpp_qsv: fix the infinite loop while framerate lower than input

Linjie Fu linjie.fu at intel.com
Fri Feb 28 17:30:31 EET 2020


There are frame droppings in frc while converting into a lower framerate,
and MSDK returns ERROR_MORE_DATA which should be ignored.

Reported-by: Gupta, Pallavi <pallavi.gupta at intel.com>
Signed-off-by: Linjie Fu <linjie.fu at intel.com>
---
Could be reproduced by:
ffmpeg -hwaccel qsv -c:v hevc_qsv -i input_25fps.h265
        -vf vpp_qsv=framerate=20
        -c:v hevc_qsv -b:v 4M 4M20FPS.mp4

 libavfilter/vf_vpp_qsv.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c
index 8585874..0218c2a 100644
--- a/libavfilter/vf_vpp_qsv.c
+++ b/libavfilter/vf_vpp_qsv.c
@@ -476,6 +476,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
 
     if (vpp->qsv) {
         ret = ff_qsvvpp_filter_frame(vpp->qsv, inlink, picref);
+        /* ignore the EAGAIN caused by frame dropping in frc */
+        if (ret == AVERROR(EAGAIN))
+            ret = av_cmp_q(vpp->framerate, inlink->frame_rate) < 0 ? 0 : ret;
         av_frame_free(&picref);
     } else {
         if (picref->pts != AV_NOPTS_VALUE)
-- 
2.7.4



More information about the ffmpeg-devel mailing list