Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PR] avcodec/libx265: map ffmpeg log level to x265 log level (PR #21465)
@ 2026-01-14 13:47 Zhao Zhili via ffmpeg-devel
  0 siblings, 0 replies; only message in thread
From: Zhao Zhili via ffmpeg-devel @ 2026-01-14 13:47 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Zhao Zhili

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-01-14 13:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-14 13:47 [FFmpeg-devel] [PR] avcodec/libx265: map ffmpeg log level to x265 log level (PR #21465) Zhao Zhili via ffmpeg-devel

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