From b4621d00442b26026561a9b6c21a264a74bd23ac Mon Sep 17 00:00:00 2001 From: Martin Sekera Date: Sun, 10 Mar 2019 16:30:17 +0100 Subject: [PATCH] fix normalization to conform to EBU R128 --- over-video.py | 9 +++++++-- version.py | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/over-video.py b/over-video.py index 77b737a..3439390 100755 --- a/over-video.py +++ b/over-video.py @@ -22,7 +22,7 @@ X264_BANNED_PIXFMTS = {"bgr24", "yuv422p"} # see doc/command_assembler.png command = over.types.ndict() command.identify = Command("ffprobe", "-v", "quiet", "-print_format", "json", "-show_format", "-show_streams", "INFILE") -command.normalize_prepass = Command("ffmpeg", "-i", "INFILE", "-filter:a", "loudnorm=I=-16:TP=-1.5:LRA=11:print_format=json", "-f", "null", "/dev/null") +command.normalize_prepass = Command("ffmpeg", "-i", "INFILE", "-filter:a", "loudnorm=i=-23.0:tp=-2.0:lra=7.0:print_format=json", "-f", "null", "/dev/null") command.encode_generic = Command("ffmpeg", "FPS", "CUT_FROM", "-i", "INFILE", "-threads", str(multiprocessing.cpu_count()), "CUT_TO", "MAP", "VIDEO", "AUDIO", "-sn", "OUTFILE") command.sub_mp3 = Command("-codec:a", "libmp3lame", "NORMALIZE") command.sub_opus = Command("-codec:a", "libopus", "NORMALIZE") @@ -276,7 +276,12 @@ if __name__ == "__main__": info.normalize_command = command.sub_normalize info.normalize_command.reset() - info.normalize_command.LOUDNORM_INCANTATION = "loudnorm=I=-16:TP=-1.5:LRA=11:measured_I=%.02f:measured_LRA=%.02f:measured_TP=%.02f:measured_thresh=%.02f:offset=%.02f:linear=true" %(info.loudnorm.input_i, info.loudnorm.input_lra, info.loudnorm.input_tp, info.loudnorm.input_thresh, info.loudnorm.target_offset) + info.normalize_command.LOUDNORM_INCANTATION = "loudnorm=i=-23.0:lra=7.0:tp=-2.0:offset=0.0:measured_i=%.02f:measured_lra=%.02f:measured_tp=%.02f:measured_thresh=%.02f:linear=true" %( + info.loudnorm.input_i, + info.loudnorm.input_lra, + info.loudnorm.input_tp, + info.loudnorm.input_thresh + ) else: info.normalize_command = None diff --git a/version.py b/version.py index 4bf62dc..c716421 100644 --- a/version.py +++ b/version.py @@ -2,7 +2,7 @@ # encoding: utf-8 major = 1 # VERSION_MAJOR_IDENTIFIER -minor = 111 # VERSION_MINOR_IDENTIFIER -# VERSION_LAST_MM 1.111 -patch = 2 # VERSION_PATCH_IDENTIFIER +minor = 112 # VERSION_MINOR_IDENTIFIER +# VERSION_LAST_MM 1.112 +patch = 0 # VERSION_PATCH_IDENTIFIER str = ".".join(str(v) for v in (major, minor, patch))