summaryrefslogtreecommitdiff
path: root/libmat2/video.py
diff options
context:
space:
mode:
authortguinot2020-02-10 03:31:07 +0100
committerjvoisin2020-02-11 17:23:11 +0100
commit56d2c4aa5fea506abb15d71b53aea23b9dd3398b (patch)
tree16a35a9e88694e227584513d7b0e4a3499844e67 /libmat2/video.py
parent12f23e0150906ccfac03254276a6af4bbe74f7c8 (diff)
Add which pathfinding for executables
Diffstat (limited to '')
-rw-r--r--libmat2/video.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/libmat2/video.py b/libmat2/video.py
index 2b33bc0..b4a3232 100644
--- a/libmat2/video.py
+++ b/libmat2/video.py
@@ -1,6 +1,6 @@
1import subprocess 1import subprocess
2import functools 2import functools
3import os 3import shutil
4import logging 4import logging
5 5
6from typing import Dict, Union 6from typing import Dict, Union
@@ -137,9 +137,8 @@ class MP4Parser(AbstractFFmpegParser):
137 137
138@functools.lru_cache() 138@functools.lru_cache()
139def _get_ffmpeg_path() -> str: # pragma: no cover 139def _get_ffmpeg_path() -> str: # pragma: no cover
140 ffmpeg_path = '/usr/bin/ffmpeg' 140 which_path = shutil.which('ffmpeg')
141 if os.path.isfile(ffmpeg_path): 141 if which_path:
142 if os.access(ffmpeg_path, os.X_OK): 142 return which_path
143 return ffmpeg_path
144 143
145 raise RuntimeError("Unable to find ffmpeg") 144 raise RuntimeError("Unable to find ffmpeg")