Signed-off-by: Marc-Antoine Arnaud <marc-antoine.arn...@luminvent.com>
--- libavcodec/libopenjpegenc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c index 01b67dffda4..06937cb9cac 100644 --- a/libavcodec/libopenjpegenc.c +++ b/libavcodec/libopenjpegenc.c @@ -301,6 +301,12 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx) break; } + // overwrite the bitrate if it's upper to 10M (default value is 200k) + if (avctx->bit_rate > 10000000) { + ctx->enc_params.max_cs_size = avctx->bit_rate * avctx->time_base.num / 8 / avctx->time_base.den; + ctx->enc_params.max_comp_size = ctx->enc_params.max_cs_size / 1.25; + } + switch (ctx->profile) { case OPJ_CINEMA2K: if (ctx->enc_params.rsiz == OPJ_PROFILE_CINEMA_4K) { -- 2.39.3 (Apple Git-146) _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".