[FFmpeg-devel] From: Sven Dueking <sven at nablet.com>

Sven Dueking svennablet at gmail.com
Fri Aug 14 11:34:29 CEST 2015


---
 libavcodec/qsvenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 57f5fe4..af4b5af 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -121,7 +121,7 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
     case MFX_RATECONTROL_VBR:
         q->param.mfx.InitialDelayInKB = avctx->rc_initial_buffer_occupancy / 1000;
         q->param.mfx.TargetKbps       = avctx->bit_rate / 1000;
-        q->param.mfx.MaxKbps          = avctx->bit_rate / 1000;
+        q->param.mfx.MaxKbps          = q->param.mfx.RateControlMethod == MFX_RATECONTROL_VBR ? avctx->rc_max_rate / 1000 : avctx->bit_rate / 1000;
         break;
     case MFX_RATECONTROL_CQP:
         quant = avctx->global_quality / FF_QP2LAMBDA;
-- 
1.8.3.1



More information about the ffmpeg-devel mailing list