From 0457582ed52565072bb1021055f69d19ca727baf Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Mon, 21 Nov 2022 15:56:18 +0000 Subject: [PATCH] Use file: URI to not let ffmpeg fall over with colons in names --- rei_toolbox/dubstrip.py | 6 +++--- tests/test_dubstrip.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rei_toolbox/dubstrip.py b/rei_toolbox/dubstrip.py index 5fe4792..7e129a3 100644 --- a/rei_toolbox/dubstrip.py +++ b/rei_toolbox/dubstrip.py @@ -34,8 +34,8 @@ def has_audio_not_in_lang(meta: Dict[str, Any], lang: str) -> bool: def make_dubstrip_command( file: Path, outfile: Path, meta: Dict[str, Any], keep_lang: str -) -> List[Union[str, Path]]: - cmd = ["ffmpeg", "-nostdin", "-i", file, "-map", "0"] +) -> List[str]: + cmd = ["ffmpeg", "-nostdin", "-i", f"file:{file}", "-map", "0"] for stream in meta["streams"]: if stream["codec_type"] == "audio": @@ -44,7 +44,7 @@ def make_dubstrip_command( cmd += ["-map", f"-0:{idx}"] # Only remux; don't recode. - cmd += ["-c", "copy", outfile] + cmd += ["-c", "copy", f"file:{outfile}"] return cmd diff --git a/tests/test_dubstrip.py b/tests/test_dubstrip.py index 6ad08cc..8d1aa92 100644 --- a/tests/test_dubstrip.py +++ b/tests/test_dubstrip.py @@ -28,13 +28,13 @@ class DubstripTestCase(unittest.TestCase): "ffmpeg", "-nostdin", "-i", - fin, + "file:a.mkv", "-map", "0", "-map", "-0:1", "-c", "copy", - fout, + "file:b.mkv", ], )