honor --ffmpeg-map even during normalization
This commit is contained in:
parent
b4621d0044
commit
2929725416
2 changed files with 13 additions and 11 deletions
|
@ -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=-23.0:tp=-2.0:lra=7.0:print_format=json", "-f", "null", "/dev/null")
|
||||
command.normalize_prepass = Command("ffmpeg", "-i", "INFILE", "MAP", "-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")
|
||||
|
@ -216,6 +216,16 @@ if __name__ == "__main__":
|
|||
else:
|
||||
main.print("<c>audio<.>: <y>None<.>", main.print.tl.warn)
|
||||
|
||||
# prepare input stream mapping (which needs to be correct even for the normalization pre-pass)
|
||||
if main.cfg.ffmpeg_map:
|
||||
info.map_command = []
|
||||
|
||||
for m in main.cfg.ffmpeg_map:
|
||||
info.map_command.append("-map")
|
||||
info.map_command.append(m)
|
||||
else:
|
||||
info.map_command = None
|
||||
|
||||
# --------------------------------------------------
|
||||
# normalization pre-pass
|
||||
|
||||
|
@ -224,6 +234,7 @@ if __name__ == "__main__":
|
|||
|
||||
command.normalize_prepass.reset()
|
||||
command.normalize_prepass.INFILE = "file:" + str(files.infile)
|
||||
command.normalize_prepass.MAP = info.map_command
|
||||
command.normalize_prepass.run(stderr=True)
|
||||
|
||||
pb = over.text.ProgressBar(
|
||||
|
@ -339,15 +350,6 @@ if __name__ == "__main__":
|
|||
else:
|
||||
info.vfilter_command = None
|
||||
|
||||
if main.cfg.ffmpeg_map:
|
||||
info.map_command = []
|
||||
|
||||
for m in main.cfg.ffmpeg_map:
|
||||
info.map_command.append("-map")
|
||||
info.map_command.append(m)
|
||||
else:
|
||||
info.map_command = None
|
||||
|
||||
encode_cmd.MAP = info.map_command
|
||||
|
||||
if main.cfg.video == "copy":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue