diff options
author | Maxym Dmytrychenko <maxim.d33@gmail.com> | 2018-04-02 15:17:23 +0200 |
---|---|---|
committer | Maxym Dmytrychenko <maxim.d33@gmail.com> | 2018-04-08 20:47:59 +0200 |
commit | cca5e4f040971db6de0bfe6968f00c021d8a9c42 (patch) | |
tree | 8d9dc68ef641717b1d91283f712da6dcb5947a7f /libavcodec/qsvenc.c | |
parent | 29a8ed766354c45c9be4b8512c5b2eb25a450cdc (diff) | |
download | ffmpeg-cca5e4f040971db6de0bfe6968f00c021d8a9c42.tar.gz |
qsv: adding Multi Frame Encode support
Starting from API 1.25 helps to improve performance of the simultaneous
encode, 1:N scenario, like:
./avconv -y -hwaccel qsv -c:v h264_qsv -r 30000/1001 -i
~/bbb_sunflower_1080p_60fps_normal.mp4 -vframes 600 -an \
-filter_complex "split=2[s1][s2]; [s1]scale_qsv=1280:720[o1];
[s2]scale_qsv=960:540[o2]" \
-map [o1] -c:v h264_qsv -b:v 3200k -minrate 3200k -maxrate 3200k -f
rawvideo /tmp/3200a.264 \
-map [o2] -c:v h264_qsv -b:v 1750k -minrate 1750k -maxrate 1750k -f
rawvideo /tmp/1750a.264
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
Diffstat (limited to 'libavcodec/qsvenc.c')
-rw-r--r-- | libavcodec/qsvenc.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index f6b1a0d676..a8b446c5bd 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -135,7 +135,7 @@ static void dump_video_param(AVCodecContext *avctx, QSVEncContext *q, #if QSV_HAVE_CO2 mfxExtCodingOption2 *co2 = (mfxExtCodingOption2*)coding_opts[1]; #endif -#if QSV_HAVE_CO3 +#if QSV_HAVE_CO3 && QSV_HAVE_QVBR mfxExtCodingOption3 *co3 = (mfxExtCodingOption3*)coding_opts[2]; #endif @@ -657,6 +657,20 @@ FF_ENABLE_DEPRECATION_WARNINGS q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer *)&q->extco2; } #endif +#if QSV_HAVE_MF + if (avctx->codec_id == AV_CODEC_ID_H264) { + mfxVersion ver; + ret = MFXQueryVersion(q->session,&ver); + if (ret >= MFX_ERR_NONE && QSV_RUNTIME_VERSION_ATLEAST(ver, 1, 25)) { + q->extmfp.Header.BufferId = MFX_EXTBUFF_MULTI_FRAME_PARAM; + q->extmfp.Header.BufferSz = sizeof(q->extmfp); + + q->extmfp.MFMode = q->mfmode; + av_log(avctx,AV_LOG_VERBOSE,"MFMode:%d\n", q->extmfp.MFMode); + q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer *)&q->extmfp; + } + } +#endif } if (!check_enc_param(avctx,q)) { |