Grass Cutters Together: the project as of moon-sweepers f3666f0
A clean start for the shared repository: the Unity project (Assets, Packages, ProjectSettings), ArtSource, Docs and Tools as they stood at f3666f0 in the old local repository, with its generated prefabs and scene brought up to date. Images, audio, models and binaries go through Git LFS (.gitattributes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
23
Tools/Trailer/remix.py
Normal file
23
Tools/Trailer/remix.py
Normal file
@ -0,0 +1,23 @@
|
||||
"""Lays the sound of an edit again under a finished render, picture untouched: py -I remix.py edl.py film.mp4"""
|
||||
import importlib.util
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
import cut # noqa: E402
|
||||
|
||||
spec = importlib.util.spec_from_file_location("edl", sys.argv[1])
|
||||
edl = importlib.util.module_from_spec(spec)
|
||||
sys.modules["edl"] = edl
|
||||
spec.loader.exec_module(edl)
|
||||
film = sys.argv[2]
|
||||
wav = film + ".remix.wav"
|
||||
song = cut.decode(getattr(edl, "TRACK", cut.TRACK)) * getattr(edl, "TRACK_GAIN", 1.0)
|
||||
cut.mix(song, cut.Clock(edl.KEEP), getattr(edl, "SFX", []), wav)
|
||||
tmp = film + ".remix.mp4"
|
||||
subprocess.run(["ffmpeg", "-y", "-v", "error", "-i", film, "-i", wav, "-map", "0:v", "-map", "1:a", "-c:v", "copy", "-c:a", "aac", "-b:a", "320k",
|
||||
"-shortest", "-movflags", "+faststart", tmp], check=True)
|
||||
os.replace(tmp, film)
|
||||
os.remove(wav)
|
||||
print("remixed", film)
|
||||
Reference in New Issue
Block a user