From c2e6fcc173794986e62fe574c71e5afaabd17047 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 8 Nov 2023 23:55:08 +0100 Subject: [PATCH] abort if front/back are not the same duration --- render.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/render.py b/render.py index 1f88a6c..b551831 100644 --- a/render.py +++ b/render.py @@ -451,6 +451,12 @@ def render_all(options): for cmd in cmds: #print(" ".join([str(x) for x in cmd])) subprocess.call(cmd) + ft = ox.avinfo(fragment_prefix / "front-5.1.mp4")['duration'] + bt = ox.avinfo(fragment_prefix / "back.mp4")['duration'] + if ft != bt: + print(ft, fragment_prefix / "front-5.1.mp4") + print(bt, fragment_prefix / "back.mp4") + sys.exit(-1) shutil.move(fragment_prefix / "front-5.1.mp4", fragment_prefix / "front.mp4") for fn in ( "audio-5.1.mp4", "fl.wav", "fr.wav", "fc.wav", "lfe.wav", "bl.wav", "br.wav", @@ -458,6 +464,7 @@ def render_all(options): fn = fragment_prefix / fn if os.path.exists(fn): os.unlink(fn) + print("Duration - Target: %s Actual: %s" % (target_position, position)) with open(_cache, "w") as fd: json.dump(_CACHE, fd)