From fbeff23698af19f54a0e1a49ccfc1719365727fa Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 9 Jul 2024 15:03:08 +0200 Subject: [PATCH] vcomp/lavc: do not log CRF/CQP setting twice info already printed with chec_av_opt_set \+ prints eventual error with error verboseity (template second parameter) --- src/video_compress/libavcodec.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/video_compress/libavcodec.cpp b/src/video_compress/libavcodec.cpp index f1ed101ba..41cc9e7a5 100644 --- a/src/video_compress/libavcodec.cpp +++ b/src/video_compress/libavcodec.cpp @@ -830,9 +830,8 @@ static void set_cqp(struct AVCodecContext *codec_ctx, int requested_cqp) { codec_ctx->global_quality = cqp; LOG(LOG_LEVEL_INFO) << MOD_NAME "Setting QSV global_quality to " << cqp << "\n"; } else { - if (check_av_opt_set(codec_ctx->priv_data, "qp", cqp, "CQP")) { - LOG(LOG_LEVEL_INFO) << MOD_NAME "Setting CQP to " << cqp << "\n"; - } + check_av_opt_set(codec_ctx->priv_data, "qp", cqp, + "CQP"); } } @@ -867,9 +866,8 @@ bool set_codec_ctx_params(struct state_video_compress_libav *s, AVPixelFormat pi const double crf = s->params.requested_crf >= 0.0 ? s->params.requested_crf : get_default_crf(s->codec_ctx->codec->name); - if (check_av_opt_set(s->codec_ctx->priv_data, "crf", crf)) { - log_msg(LOG_LEVEL_INFO, "[lavc] Setting CRF to %.2f.\n", crf); - } + check_av_opt_set(s->codec_ctx->priv_data, "crf", + crf, "CRF"); } else if (strcmp(s->codec_ctx->codec->name, "libopenh264") != 0) { set_bitrate = true; }