[FFmpeg-devel] [PATCH v1] avcodec/v4l2_m2m_enc: Set bitrate mode to cbr by default

Ming Qian ming.qian at nxp.com
Wed Apr 29 11:14:26 EEST 2020


    Without this setting, bitrate may have no effect
    if the default value of bitrate mode is VBR.

Signed-off-by: Ming Qian <ming.qian at nxp.com>
---
 libavcodec/v4l2_m2m_enc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c
index 8454e2326c..6296ad88c6 100644
--- a/libavcodec/v4l2_m2m_enc.c
+++ b/libavcodec/v4l2_m2m_enc.c
@@ -191,6 +191,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_MODE), MPEG_VIDEO(BITRATE_MODE_CBR), "bit rate mode", 1);
     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);
-- 
2.26.0



More information about the ffmpeg-devel mailing list