From eaa991aaf6e2325ea735401d4434dd7932a9d888 Mon Sep 17 00:00:00 2001 From: harry Date: Sun, 24 Mar 2024 16:59:16 +0800 Subject: [PATCH] Added ffmpeg_path parameter to the config file. --- app/config/config.py | 4 ++++ config.example.toml | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/app/config/config.py b/app/config/config.py index c843fd5..f4866ed 100644 --- a/app/config/config.py +++ b/app/config/config.py @@ -28,6 +28,10 @@ imagemagick_path = app.get("imagemagick_path", "") if imagemagick_path and os.path.isfile(imagemagick_path): os.environ["IMAGEMAGICK_BINARY"] = imagemagick_path +ffmpeg_path = app.get("ffmpeg_path", "") +if ffmpeg_path and os.path.isfile(ffmpeg_path): + os.environ["IMAGEIO_FFMPEG_EXE"] = ffmpeg_path + # __cfg = { # "hostname": hostname, # "listen_host": listen_host, diff --git a/config.example.toml b/config.example.toml index 69ea2ab..e2aafb6 100644 --- a/config.example.toml +++ b/config.example.toml @@ -36,11 +36,34 @@ # If empty, the subtitle will not be generated subtitle_provider = "edge" + # + # ImageMagick + # # Once you have installed it, ImageMagick will be automatically detected, except on Windows! # On Windows, for example "C:\Program Files (x86)\ImageMagick-7.1.1-Q16-HDRI\magick.exe" # Download from https://imagemagick.org/archive/binaries/ImageMagick-7.1.1-29-Q16-x64-static.exe + # imagemagick_path = "C:\\Program Files (x86)\\ImageMagick-7.1.1-Q16\\magick.exe" + + # + # FFMPEG + # + # 通常情况下,ffmpeg 会被自动下载,并且会被自动检测到。 + # 但是如果你的环境有问题,无法自动下载,可能会遇到如下错误: + # RuntimeError: No ffmpeg exe could be found. + # Install ffmpeg on your system, or set the IMAGEIO_FFMPEG_EXE environment variable. + # 此时你可以手动下载 ffmpeg 并设置 ffmpeg_path,下载地址:https://www.gyan.dev/ffmpeg/builds/ + + # Under normal circumstances, ffmpeg is downloaded automatically and detected automatically. + # However, if there is an issue with your environment that prevents automatic downloading, you might encounter the following error: + # RuntimeError: No ffmpeg exe could be found. + # Install ffmpeg on your system, or set the IMAGEIO_FFMPEG_EXE environment variable. + # In such cases, you can manually download ffmpeg and set the ffmpeg_path, download link: https://www.gyan.dev/ffmpeg/builds/ + + # ffmpeg_path = "C:\\Users\\harry\\Downloads\\ffmpeg.exe" + ######################################################################################### + [whisper] # Only effective when subtitle_provider is "whisper"