Skip to content

Commit

Permalink
vcomp/lavc libsvtavi: allow bitrate with CRF
Browse files Browse the repository at this point in the history
This sets Max Bitrate for CRF RC.
  • Loading branch information
MartinPulec committed Jul 10, 2024
1 parent 8737896 commit 208c2f2
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/video_compress/libavcodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1955,10 +1955,23 @@ static void configure_svt(AVCodecContext *codec_ctx, struct setparam_param *para
//pred-struct=1 is low-latency mode
char params[STR_LEN] = "pred-struct=1:";
if (param->requested_bitrate > 0) {
params[0] = '\0'; // do not set pred-struct for VBR
MSG(WARNING, "Bitrate setting for SVT AV1 is not "
"recommended since it increases latency, "
"use CRF/CQP if possible\n");
if (param->requested_crf == -1) {
params[0] =
'\0'; // do not set pred-struct for VBR
MSG(WARNING,
"Bitrate setting without crf for SVT AV1 "
"is not recommended since it increases "
"latency, prefer CRF/CQP if possible\n");
MSG(WARNING,
"However, you can specify _both_ crf and "
"bitrate options to set bitrate limit.\n");
} else {
codec_ctx->rc_max_rate = param->requested_bitrate;
codec_ctx->bit_rate = 0;
MSG(INFO,
"Setting rc_max_rate to %" PRId64 "\n",
codec_ctx->rc_max_rate);
}
}
snprintf(params + strlen(params),
sizeof params - strlen(params), "%s",
Expand Down

0 comments on commit 208c2f2

Please sign in to comment.