From 63346875d3693778f71eed0672776458238513f3 Mon Sep 17 00:00:00 2001 From: pat-e Date: Thu, 6 Nov 2025 16:20:28 +0100 Subject: [PATCH] Changed Values of the loudnorm filter --- av1_opus_encoder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/av1_opus_encoder.py b/av1_opus_encoder.py index 35a3330..1301ad4 100644 --- a/av1_opus_encoder.py +++ b/av1_opus_encoder.py @@ -72,7 +72,7 @@ def convert_audio_track(index, ch, lang, audio_temp_dir, source_file, should_dow # The stats are printed to stderr, so we must use subprocess.run directly to capture it. print(" - Pass 1: Analyzing...") result = subprocess.run( - ["ffmpeg", "-v", "info", "-i", str(temp_extracted), "-af", "loudnorm=I=-18:LRA=7:tp=-1:print_format=json", "-f", "null", "-"], + ["ffmpeg", "-v", "info", "-i", str(temp_extracted), "-af", "loudnorm=I=-24:LRA=7:tp=-2:print_format=json", "-f", "null", "-"], capture_output=True, text=True, check=True) # Find the start of the JSON block in stderr and parse it. @@ -100,7 +100,7 @@ def convert_audio_track(index, ch, lang, audio_temp_dir, source_file, should_dow print(" - Pass 2: Applying normalization...") run_cmd([ "ffmpeg", "-v", "quiet", "-stats", "-y", "-i", str(temp_extracted), "-af", - f"loudnorm=I=-18:LRA=7:tp=-1:measured_i={stats['input_i']}:measured_lra={stats['input_lra']}:measured_tp={stats['input_tp']}:measured_thresh={stats['input_thresh']}:offset={stats['target_offset']}", + f"loudnorm=I=-24:LRA=7:tp=-2:measured_i={stats['input_i']}:measured_lra={stats['input_lra']}:measured_tp={stats['input_tp']}:measured_thresh={stats['input_thresh']}:offset={stats['target_offset']}", "-c:a", "flac", str(temp_normalized) ])