Fix a crash when using vpy input with a space in the filename

This commit is contained in:
Josh Holmer 2021-03-25 08:44:31 -05:00
parent 35d4977062
commit b79b61d03a

View file

@ -16,8 +16,8 @@ def frame_probe_vspipe(source: Path):
Get frame count from vspipe.
:param: source: Path to input vapoursynth (vpy/py) file
"""
cmd = f"vspipe -i {source.as_posix()} -"
r = run(split(cmd), capture_output=True)
cmd = ["vspipe", "-i", source.as_posix(), "-"]
r = run(cmd, capture_output=True)
matches = re.findall(r"Frames:\s*([0-9]+)\s",
r.stderr.decode("utf-8") + r.stdout.decode("utf-8"))
frames = int(matches[-1])