[FFmpeg-cvslog] lavfi/qsvvpp: set output frame durations

Haihao Xiang git at videolan.org
Tue Jan 17 08:14:04 EET 2023


ffmpeg | branch: master | Haihao Xiang <haihao.xiang at intel.com> | Mon Jan  9 15:12:09 2023 +0800| [3763635ef40c59ce02e79efc0f117e1298a775d9] | committer: Haihao Xiang

lavfi/qsvvpp: set output frame durations

Signed-off-by: Haihao Xiang <haihao.xiang at intel.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3763635ef40c59ce02e79efc0f117e1298a775d9
---

 libavfilter/qsvvpp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index 064b105a17..f074bf9978 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -503,6 +503,11 @@ static QSVFrame *query_frame(QSVVPPContext *s, AVFilterLink *outlink)
             return NULL;
     }
 
+    if (outlink->frame_rate.num && outlink->frame_rate.den)
+        out_frame->frame->duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base);
+    else
+        out_frame->frame->duration = 0;
+
     out_frame->frame->width  = outlink->w;
     out_frame->frame->height = outlink->h;
     out_frame->surface.Info = s->vpp_param.vpp.Out;



More information about the ffmpeg-cvslog mailing list