From: Zhao Zhili via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Zhao Zhili <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PR] avcodec/libx265: map ffmpeg log level to x265 log level (PR #21465)
Date: Wed, 14 Jan 2026 13:47:53 -0000
Message-ID: <176839847448.25.15782479631611962532@4457048688e7> (raw)
PR #21465 opened by Zhao Zhili (quink)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21465
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21465.patch
Previously x265 encoder used its default log level regardless of
FFmpeg's log level setting. Note the log level can be overwritten
by x265-params.
Fix #21462
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
>From 93225b4554d94ab39bd2e2c7598320eb1a1b1c91 Mon Sep 17 00:00:00 2001
From: Zhao Zhili <zhilizhao@tencent.com>
Date: Wed, 14 Jan 2026 21:28:00 +0800
Subject: [PATCH] avcodec/libx265: map ffmpeg log level to x265 log level
Previously x265 encoder used its default log level regardless of
FFmpeg's log level setting. Note the log level can be overwritten
by x265-params.
Fix #21462
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
libavcodec/libx265.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index 341868e7cd..b571e35101 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -250,6 +250,24 @@ static int handle_side_data(AVCodecContext *avctx, const x265_api *api,
return 0;
}
+static int get_x265_log_level(AVCodecContext *avctx)
+{
+ int level = av_log_get_level() + avctx->log_level_offset;;
+
+ if (level <= AV_LOG_QUIET)
+ return X265_LOG_NONE;
+ if (level <= AV_LOG_ERROR)
+ return X265_LOG_ERROR;
+ if (level <= AV_LOG_WARNING)
+ return X265_LOG_WARNING;
+ if (level <= AV_LOG_INFO)
+ return X265_LOG_INFO;
+ if (level <= AV_LOG_DEBUG)
+ return X265_LOG_DEBUG;
+
+ return X265_LOG_FULL;
+}
+
static av_cold int libx265_encode_init(AVCodecContext *avctx)
{
libx265Context *ctx = avctx->priv_data;
@@ -285,6 +303,7 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
return AVERROR(EINVAL);
}
+ ctx->params->logLevel = get_x265_log_level(avctx);
ctx->params->frameNumThreads = avctx->thread_count;
if (avctx->framerate.num > 0 && avctx->framerate.den > 0) {
ctx->params->fpsNum = avctx->framerate.num;
--
2.49.1
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
reply other threads:[~2026-01-14 13:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=176839847448.25.15782479631611962532@4457048688e7 \
--to=ffmpeg-devel@ffmpeg.org \
--cc=code@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git