aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/qsvenc.h
diff options
context:
space:
mode:
authorMandava, Mounika <mounika.mandava@intel.com>2024-02-29 13:34:34 +0800
committerHaihao Xiang <haihao.xiang@intel.com>2024-05-07 11:06:37 +0800
commitb1037d4ebe7b7f9548ce1ed24a2929aedbe9a27a (patch)
tree66fbbb97758f6e41c98ceef29891435c5d8e4f77 /libavcodec/qsvenc.h
parentdf76c3756d41e909b78565f49928c43c0f84caf0 (diff)
downloadffmpeg-b1037d4ebe7b7f9548ce1ed24a2929aedbe9a27a.tar.gz
lavc/qsvenc: add support for oneVPL string API
A new option -qsv_params <str> is added, where <str> is a :-separated list of key=value parameters. Example: $ ffmpeg -y -f lavfi -i testsrc -vf "format=nv12" -c:v h264_qsv -qsv_params "TargetUsage=1:GopPicSize=30:GopRefDist=2:TargetKbps=5000" -f null - Signed-off-by: Mounika Mandava <mounika.mandava@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Diffstat (limited to 'libavcodec/qsvenc.h')
-rw-r--r--libavcodec/qsvenc.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
index f2f0687bfe..e3eb083746 100644
--- a/libavcodec/qsvenc.h
+++ b/libavcodec/qsvenc.h
@@ -64,7 +64,8 @@
{ "slower", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_2 }, INT_MIN, INT_MAX, VE, .unit = "preset" }, \
{ "veryslow", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BEST_QUALITY }, INT_MIN, INT_MAX, VE, .unit = "preset" }, \
{ "forced_idr", "Forcing I frames as IDR frames", OFFSET(qsv.forced_idr), AV_OPT_TYPE_BOOL,{ .i64 = 0 }, 0, 1, VE }, \
-{ "low_power", "enable low power mode(experimental: many limitations by mfx version, BRC modes, etc.)", OFFSET(qsv.low_power), AV_OPT_TYPE_BOOL, { .i64 = -1}, -1, 1, VE},
+{ "low_power", "enable low power mode(experimental: many limitations by mfx version, BRC modes, etc.)", OFFSET(qsv.low_power), AV_OPT_TYPE_BOOL, { .i64 = -1}, -1, 1, VE},\
+{ "qsv_params", "Set QSV encoder parameters as key1=value1:key2=value2:...", OFFSET(qsv.qsv_params), AV_OPT_TYPE_DICT, { 0 }, 0, 0, VE },
#if QSV_HAVE_HE
#define QSV_HE_OPTIONS \
@@ -195,6 +196,9 @@ typedef struct QSVEncContext {
mfxExtBuffer *extparam_internal[5 + (QSV_HAVE_MF * 2) + (QSV_HAVE_EXT_AV1_PARAM * 2) + QSV_HAVE_HE];
int nb_extparam_internal;
+ mfxExtBuffer **extparam_str;
+ int nb_extparam_str;
+
mfxExtBuffer **extparam;
int nb_extparam;
@@ -315,6 +319,8 @@ typedef struct QSVEncContext {
int skip_frame;
// This is used for Hyper Encode
int dual_gfx;
+
+ AVDictionary *qsv_params;
} QSVEncContext;
int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext *q);