abort if front/back are not the same duration

This commit is contained in:
j 2023-11-08 23:55:08 +01:00
parent 60bd70704f
commit c2e6fcc173

View file

@ -451,6 +451,12 @@ def render_all(options):
for cmd in cmds: for cmd in cmds:
#print(" ".join([str(x) for x in cmd])) #print(" ".join([str(x) for x in cmd]))
subprocess.call(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") shutil.move(fragment_prefix / "front-5.1.mp4", fragment_prefix / "front.mp4")
for fn in ( for fn in (
"audio-5.1.mp4", "fl.wav", "fr.wav", "fc.wav", "lfe.wav", "bl.wav", "br.wav", "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 fn = fragment_prefix / fn
if os.path.exists(fn): if os.path.exists(fn):
os.unlink(fn) os.unlink(fn)
print("Duration - Target: %s Actual: %s" % (target_position, position)) print("Duration - Target: %s Actual: %s" % (target_position, position))
with open(_cache, "w") as fd: with open(_cache, "w") as fd:
json.dump(_CACHE, fd) json.dump(_CACHE, fd)