[FFmpeg-devel] [PATCH] lavf/qsvvpp: add extra_hw_frames support

Zhong Li zhong.li at intel.com
Wed Jun 5 11:56:27 EEST 2019


extra_hw_frames is needed for some cases.
(eg: qsv decoding + qsv vpp + qsv look_ahead encoding, transcoding
 failed if no extra_hw_frames supported:
 ffmpeg -hwaccel qsv -c:v h264_qsv -i bbb_sunflower_1080p_30fps_normal_2000frames.mp4 \
-vf vpp_qsv=w=1280:h=720:extra_hw_frames=100 -v verbose  -c:v h264_qsv \
-look_ahead 1 -look_ahead_depth 100 out1.mp4
)

Signed-off-by: Zhong Li <zhong.li at intel.com>
---
 libavfilter/qsvvpp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index 62b91d6..49cb1ed 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -462,6 +462,8 @@ static int init_vpp_session(AVFilterContext *avctx, QSVVPPContext *s)
         out_frames_ctx->height            = FFALIGN(outlink->h, 32);
         out_frames_ctx->sw_format         = s->out_sw_format;
         out_frames_ctx->initial_pool_size = 64;
+        if (avctx->extra_hw_frames > 0)
+            out_frames_ctx->initial_pool_size += avctx->extra_hw_frames;
         out_frames_hwctx->frame_type      = s->out_mem_mode;
 
         ret = av_hwframe_ctx_init(out_frames_ref);
-- 
2.7.4



More information about the ffmpeg-devel mailing list