diff mbox series

[FFmpeg-devel,v4,2/3] avcodec/v4l2_m2m_enc: Enable frame level rate control by default

Message ID 20200223184733.13113-2-andriy.gelman@gmail.com
State Accepted
Commit 1cc3851b60d9943eb5aca56a9f9d65456471e999
Headers show
Series [FFmpeg-devel,v4,1/3] avcodec/v4l2_m2m_enc: Reduce log verbosity for some params
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Andriy Gelman Feb. 23, 2020, 6:47 p.m. UTC
From: Andriy Gelman <andriy.gelman@gmail.com>

Without this setting, bitrate and qmin/qmax options have no
affect on the s5p-mfc hardware encoder.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
---
 libavcodec/v4l2_m2m_enc.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Andriy Gelman April 27, 2020, 10:41 p.m. UTC | #1
On Sun, 23. Feb 13:47, Andriy Gelman wrote:
> From: Andriy Gelman <andriy.gelman@gmail.com>
> 
> Without this setting, bitrate and qmin/qmax options have no
> affect on the s5p-mfc hardware encoder.
> 
> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.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 859feb7bde7..0098d5314bb 100644
> --- a/libavcodec/v4l2_m2m_enc.c
> +++ b/libavcodec/v4l2_m2m_enc.c
> @@ -179,6 +179,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,
> -- 
> 2.25.0
> 

This patch was reviewed by Ming Qian <ming.qian@nxp.com>:
> Lgtm,
> Would you please set bitrate mode to cbr by default too, for some driver, if the default mode is vbr, the rc may be not token effect

I'll apply this evening if no one objects.
diff mbox series

Patch

diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c
index 859feb7bde7..0098d5314bb 100644
--- a/libavcodec/v4l2_m2m_enc.c
+++ b/libavcodec/v4l2_m2m_enc.c
@@ -179,6 +179,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,