aboutsummaryrefslogtreecommitdiff
path: root/src/toolkit/ffmpeg.py
diff options
context:
space:
mode:
authortassaron2022-04-30 00:16:38 -0400
committertassaron2022-04-30 00:16:38 -0400
commit893c10c6ca8b7a9c04b9aaa086a46503166c880b (patch)
tree48e13bce5049147a980bc191bd08ebc7490caaf9 /src/toolkit/ffmpeg.py
parent340062712cd88bd1467b40fd49892566bfbccc04 (diff)
test if ffmpeg is really found at startup
Diffstat (limited to 'src/toolkit/ffmpeg.py')
-rw-r--r--src/toolkit/ffmpeg.py31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/toolkit/ffmpeg.py b/src/toolkit/ffmpeg.py
index 256646e..5f9dec1 100644
--- a/src/toolkit/ffmpeg.py
+++ b/src/toolkit/ffmpeg.py
@@ -152,25 +152,24 @@ def closePipe(pipe):
def findFfmpeg():
+ if sys.platform == "win32":
+ bin = 'ffmpeg.exe'
+ else:
+ bin = 'ffmfpeg'
+
if getattr(sys, 'frozen', False):
# The application is frozen
- if sys.platform == "win32":
- return os.path.join(core.Core.wd, 'ffmpeg.exe')
- else:
- return os.path.join(core.Core.wd, 'ffmpeg')
+ bin = os.path.join(core.Core.wd, bin)
- else:
- if sys.platform == "win32":
- return "ffmpeg"
- else:
- try:
- with open(os.devnull, "w") as f:
- checkOutput(
- ['ffmpeg', '-version'], stderr=f
- )
- return "ffmpeg"
- except (subprocess.CalledProcessError, FileNotFoundError):
- return "avconv"
+ with open(os.devnull, "w") as f:
+ try:
+ checkOutput(
+ [bin, '-version'], stderr=f
+ )
+ except (subprocess.CalledProcessError, FileNotFoundError):
+ bin = ""
+
+ return bin
def createFfmpegCommand(inputFile, outputFile, components, duration=-1):