]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/v4l2_m2m_enc: Enable frame level rate control by default
authorAndriy Gelman <andriy.gelman@gmail.com>
Tue, 28 Apr 2020 16:39:39 +0000 (12:39 -0400)
committerAndriy Gelman <andriy.gelman@gmail.com>
Tue, 28 Apr 2020 16:39:39 +0000 (12:39 -0400)
Without this setting, bitrate and qmin/qmax options have no
effect on the s5p-mfc hardware encoder.

Reviewed-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
libavcodec/v4l2_m2m_enc.c

index 5a08e4ed1d720778c0ed77be4195c4a3cd97f988..8454e2326c4c884bb56a3f845059f82b7df3dc30 100644 (file)
@@ -192,6 +192,7 @@ static int v4l2_prepare_encoder(V4L2m2mContext *s)
     /* set ext ctrls */
     v4l2_set_ext_ctrl(s, MPEG_CID(HEADER_MODE), MPEG_VIDEO(HEADER_MODE_SEPARATE), "header mode", 0);
     v4l2_set_ext_ctrl(s, MPEG_CID(BITRATE) , avctx->bit_rate, "bit rate", 1);
+    v4l2_set_ext_ctrl(s, MPEG_CID(FRAME_RC_ENABLE), 1, "frame level rate control", 0);
     v4l2_set_ext_ctrl(s, MPEG_CID(GOP_SIZE), avctx->gop_size,"gop size", 1);
 
     av_log(avctx, AV_LOG_DEBUG,