[FFmpeg-devel] [PATCH] libx265: Update bitrate in avcontext in case it was overriden by x265 specific options

Nicolas Morey-Chaisemartin nmorey at kalray.eu
Fri Jun 13 10:49:30 CEST 2014


---
  libavcodec/libx265.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index 31b85de..38357af 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -173,7 +173,9 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
              av_dict_free(&dict);
          }
      }
-
+    if(ctx->params->rc.rateControlMode == X265_RC_ABR){
+        avctx->bit_rate = ctx->params->rc.bitrate * 1000;
+    }
      ctx->encoder = x265_encoder_open(ctx->params);
      if (!ctx->encoder) {
          av_log(avctx, AV_LOG_ERROR, "Cannot open libx265 encoder.\n");


More information about the ffmpeg-devel mailing list