From 7500f4a37fb3ff2cc3fe88faccec38c31adead24 Mon Sep 17 00:00:00 2001 From: mani Date: Tue, 6 Jan 2026 02:01:43 +0100 Subject: [PATCH] Reduce FFmpeg log verbosity and add client info to error logs - Set FFmpeg loglevel to 'error' to suppress repetitive warnings like 'Skipping NAL unit' - Add client IP and User-Agent to exception middleware logging for better debugging --- Jellyfin.Api/Middleware/ExceptionMiddleware.cs | 12 ++++++++---- .../MediaEncoding/EncodingHelper.cs | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Jellyfin.Api/Middleware/ExceptionMiddleware.cs b/Jellyfin.Api/Middleware/ExceptionMiddleware.cs index acbb4877d4..b7849b12ad 100644 --- a/Jellyfin.Api/Middleware/ExceptionMiddleware.cs +++ b/Jellyfin.Api/Middleware/ExceptionMiddleware.cs @@ -75,18 +75,22 @@ public class ExceptionMiddleware if (ignoreStackTrace) { _logger.LogError( - "Error processing request: {ExceptionMessage}. URL {Method} {Url}.", + "Error processing request: {ExceptionMessage}. URL {Method} {Url}. Client IP: {RemoteIp}, User-Agent: {UserAgent}", ex.Message.TrimEnd('.'), context.Request.Method, - context.Request.Path); + context.Request.Path, + context.Connection.RemoteIpAddress, + context.Request.Headers.UserAgent.ToString()); } else { _logger.LogError( ex, - "Error processing request. URL {Method} {Url}.", + "Error processing request. URL {Method} {Url}. Client IP: {RemoteIp}, User-Agent: {UserAgent}", context.Request.Method, - context.Request.Path); + context.Request.Path, + context.Connection.RemoteIpAddress, + context.Request.Headers.UserAgent.ToString()); } context.Response.StatusCode = GetStatusCode(ex); diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index e088cd358d..7e6f7298b9 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -7105,7 +7105,7 @@ namespace MediaBrowser.Controller.MediaEncoding public string GetInputModifier(EncodingJobInfo state, EncodingOptions encodingOptions, string segmentContainer) { - var inputModifier = string.Empty; + var inputModifier = "-loglevel error"; var analyzeDurationArgument = string.Empty; // Apply -analyzeduration as per the environment variable,