From bce188d18b4beaedcff003a4574e9fdff4af6ca1 Mon Sep 17 00:00:00 2001 From: Martin Date: Wed, 22 Jan 2025 23:05:27 +0100 Subject: [PATCH] Add a hardcoded path to ffmpeg/ffprobe in install_dir to fix macOS (#1406) --- src/tauon/t_modules/t_main.py | 37 +++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/src/tauon/t_modules/t_main.py b/src/tauon/t_modules/t_main.py index a778e4ba2..e3fc3fc87 100644 --- a/src/tauon/t_modules/t_main.py +++ b/src/tauon/t_modules/t_main.py @@ -7216,22 +7216,35 @@ def test_ffmpeg(self) -> bool: return False def get_ffmpeg(self) -> str | None: + path = user_directory / "ffmpeg.exe" + if msys and path.is_file(): + return str(path) + + # macOS + path = install_directory / "ffmpeg" + if path.is_file(): + return str(path) + logging.debug(f"Looking for ffmpeg in PATH: {os.environ.get('PATH')}") - p = shutil.which("ffmpeg") - if p: - return p - p = str(user_directory / "ffmpeg.exe") - if msys and os.path.isfile(p): - return p + path = shutil.which("ffmpeg") + if path: + return path return None def get_ffprobe(self) -> str | None: - p = shutil.which("ffprobe") - if p: - return p - p = str(user_directory / "ffprobe.exe") - if msys and os.path.isfile(p): - return p + path = user_directory / "ffprobe.exe" + if msys and path.is_file(): + return str(path) + + # macOS + path = install_directory / "ffprobe" + if path.is_file(): + return str(path) + + logging.debug(f"Looking for ffprobe in PATH: {os.environ.get('PATH')}") + path = shutil.which("ffprobe") + if path: + return path return None def bg_save(self) -> None: