[FFmpeg-devel] [PATCH 2/2] lavfi/vf_vpp_qsv: fix the time_base for outlink

Haihao Xiang haihao.xiang at intel.com
Wed Jun 9 07:18:30 EEST 2021


Since commit 89ffcd1, the pts on output pad is in the time base of the
input link, not the time base of the output link when EOF is reached, so
a filter after vpp_qsv might output some unexpected frames. In order to
avoid this issue, use the same time base for input and ouput links

The issue can be triggered with the command below:
$> ffmpeg -hwaccel qsv -c:v hevc_qsv -i input.h265 -vf
"vpp_qsv=w=1920:h=1080,fps=fps=60" -f null -

[out_0_0 @ 0x55eb017b5060] 100 buffers queued in out_0_0, something may
be wrong.
[out_0_0 @ 0x55eb017b5060] 1000 buffers queued in out_0_0, something may
be wrong.
[out_0_0 @ 0x55eb017b5060] 10000 buffers queued in out_0_0, something
may be wrong.
---
 libavfilter/vf_vpp_qsv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c
index b9ab5c6490..74d1d51e7c 100644
--- a/libavfilter/vf_vpp_qsv.c
+++ b/libavfilter/vf_vpp_qsv.c
@@ -303,7 +303,7 @@ static int config_output(AVFilterLink *outlink)
     outlink->w          = vpp->out_width;
     outlink->h          = vpp->out_height;
     outlink->frame_rate = vpp->framerate;
-    outlink->time_base  = av_inv_q(vpp->framerate);
+    outlink->time_base  = inlink->time_base;
 
     param.filter_frame  = NULL;
     param.num_ext_buf   = 0;
-- 
2.25.1



More information about the ffmpeg-devel mailing list