Add configurable FFmpeg log level

- Add FfmpegLogLevel property to EncodingOptions (default: 'error')
- Use configuration value in GetInputModifier instead of hardcoded value
- Allows changing log verbosity without rebuild via encoding.xml
- Possible values: quiet, panic, fatal, error, warning, info, verbose, debug, trace
This commit is contained in:
mani
2026-01-06 02:17:07 +01:00
parent 7500f4a37f
commit 28854ebf2e
2 changed files with 14 additions and 1 deletions

View File

@@ -7105,7 +7105,14 @@ namespace MediaBrowser.Controller.MediaEncoding
public string GetInputModifier(EncodingJobInfo state, EncodingOptions encodingOptions, string segmentContainer)
{
var inputModifier = "-loglevel error";
var inputModifier = string.Empty;
// Apply FFmpeg log level from configuration
if (!string.IsNullOrEmpty(encodingOptions.FfmpegLogLevel))
{
inputModifier = $"-loglevel {encodingOptions.FfmpegLogLevel}";
}
var analyzeDurationArgument = string.Empty;
// Apply -analyzeduration as per the environment variable,

View File

@@ -59,6 +59,7 @@ public class EncodingOptions
EnableSubtitleExtraction = true;
AllowOnDemandMetadataBasedKeyframeExtractionForExtensions = ["mkv"];
HardwareDecodingCodecs = ["h264", "vc1"];
FfmpegLogLevel = "error";
}
/// <summary>
@@ -295,4 +296,9 @@ public class EncodingOptions
/// Gets or sets the file extensions on-demand metadata based keyframe extraction is enabled for.
/// </summary>
public string[] AllowOnDemandMetadataBasedKeyframeExtractionForExtensions { get; set; }
/// <summary>
/// Gets or sets the FFmpeg log level (quiet, panic, fatal, error, warning, info, verbose, debug, trace).
/// </summary>
public string FfmpegLogLevel { get; set; }
}