Increase normalization speed, fix normalization scope when --cut is set.
This commit is contained in:
parent
fbf90f2c89
commit
1b5ab6416b
2 changed files with 7 additions and 2 deletions
|
@ -484,7 +484,7 @@ subtitle_codec_router.add_codec(codec_sdrop)
|
|||
# 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", "MAP", "-filter:a", "loudnorm=i=-23.0:tp=-2.0:lra=7.0:print_format=json", "-f", "null", "/dev/null")
|
||||
command.normalize_prepass = Command("ffmpeg", "CUT_FROM", "-i", "INFILE", "-threads", str(multiprocessing.cpu_count()), "CUT_TO", "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", "SUBTITLE", "OUTFILE")
|
||||
command.sub_vfilter = Command("-filter:v", "ARGS")
|
||||
command.sub_afilter = Command("-filter:a", "ARGS", "-ar", "48k")
|
||||
|
@ -691,6 +691,9 @@ if __name__ == "__main__":
|
|||
main.log.info("video: %s", ", ".join(video_words))
|
||||
main.log.info("container: <M>%s<.>", files.container)
|
||||
|
||||
if main.cfg.cut:
|
||||
main.log.warn("cut: start at <M>%s<.>, take <M>%s<.>", main.cfg.cut[0], main.cfg.cut[1])
|
||||
|
||||
if main.cfg.move:
|
||||
main.log.info("move source files to <W>%s<.>/", main.cfg.move)
|
||||
|
||||
|
@ -830,6 +833,8 @@ if __name__ == "__main__":
|
|||
|
||||
command.normalize_prepass.reset()
|
||||
command.normalize_prepass.INFILE = "file:" + str(files.infile)
|
||||
command.normalize_prepass.CUT_FROM = ["-ss", main.cfg.cut[0]] if main.cfg.cut else None
|
||||
command.normalize_prepass.CUT_TO = ["-to", main.cfg.cut[1]] if main.cfg.cut else None
|
||||
command.normalize_prepass.MAP = info.map_command
|
||||
command.normalize_prepass.run(stderr=True)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue