diff --git a/over-video.py b/over-video.py index 3cb1e7e..7078629 100755 --- a/over-video.py +++ b/over-video.py @@ -22,9 +22,10 @@ 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", "-max_muxing_queue_size", "512", "-filter:a", "loudnorm=I=-16:TP=-1.5:LRA=11:print_format=json", "-f", "null", "/dev/null") -command.encode_generic = Command("ffmpeg", "FPS", "CUT_FROM", "-i", "INFILE", "-max_muxing_queue_size", "512", "-threads", str(multiprocessing.cpu_count()), "CUT_TO", "MAP", "VIDEO", "AUDIO", "-sn", "OUTFILE") -command.sub_opus = Command("-codec:a", "libopus", "NORMALIZE") +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.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", "-filter:a", "channelmap=channel_layout=5.1") command.sub_vorbis = Command("-codec:a", "libvorbis", "-qscale:a", "QUALITY", "NORMALIZE") command.sub_pcm = Command("-codec:a", "pcm_s16le", "NORMALIZE") command.sub_x264 = Command("PIXFMT", "-codec:v", "libx264", "-preset", "PRESET", "-crf", "QUALITY", "-profile:v", "high", "-level", "4.2", "VFILTER") @@ -111,7 +112,7 @@ if __name__ == "__main__": if main.cfg.move_source: main.print("move source files to %s<.>/" %(main.cfg.move_source)) - if main.cfg.audio not in ("drop", "copy", "pcm", "vorbis", "opus"): + if main.cfg.audio not in ("drop", "copy", "pcm", "vorbis", "opus", "mp3"): raise ValueError("unknown audio codec: %s" %(main.cfg.audio)) if main.cfg.video not in ("drop", "copy", "x264", "x265", "vp9"): @@ -311,6 +312,11 @@ if __name__ == "__main__": command.sub_opus.NORMALIZE = info.normalize_command encode_cmd.AUDIO = command.sub_opus + elif main.cfg.audio == "mp3": + command.sub_mp3.reset() + command.sub_mp3.NORMALIZE = info.normalize_command + + encode_cmd.AUDIO = command.sub_mp3 if main.cfg.ffmpeg_vfilter: info.vfilter_command = command.sub_vfilter diff --git a/version.py b/version.py index b8ca209..e1dd9c8 100644 --- a/version.py +++ b/version.py @@ -2,7 +2,7 @@ # encoding: utf-8 major = 1 # VERSION_MAJOR_IDENTIFIER -minor = 110 # VERSION_MINOR_IDENTIFIER -# VERSION_LAST_MM 1.110 -patch = 1 # VERSION_PATCH_IDENTIFIER +minor = 111 # VERSION_MINOR_IDENTIFIER +# VERSION_LAST_MM 1.111 +patch = 0 # VERSION_PATCH_IDENTIFIER str = ".".join(str(v) for v in (major, minor, patch))