使用的gpu类型

This commit is contained in:
2022-04-21 14:45:37 +08:00
parent f79f4191c6
commit add2957cc2
2 changed files with 12 additions and 7 deletions

View File

@ -1,7 +1,7 @@
import configparser
import os.path
from flask.helpers import get_env
from flask.helpers import get_env
PROD_ENV = get_env() == "production"
@ -19,6 +19,8 @@ VIDEO_RESOLUTION = "1280x720"
FFMPEG_EXEC = "ffmpeg"
# gpu
FFMPEG_USE_GPU = False
# intel_gpu
FFMPEG_USE_INTEL_GPU = False
# bitrate
VIDEO_BITRATE = "2.5M"
# [video]
@ -60,9 +62,10 @@ def load_config():
VIDEO_CLIP_OVERFLOW_SEC = section.getfloat('overflow_sec', VIDEO_CLIP_OVERFLOW_SEC)
if config.has_section("ffmpeg"):
section = config['ffmpeg']
global FFMPEG_EXEC, FFMPEG_USE_GPU, VIDEO_BITRATE
global FFMPEG_EXEC, FFMPEG_USE_GPU, FFMPEG_USE_INTEL_GPU, VIDEO_BITRATE
FFMPEG_EXEC = section.get('exec', FFMPEG_EXEC)
FFMPEG_USE_GPU = section.getboolean('gpu', FFMPEG_USE_GPU)
FFMPEG_USE_INTEL_GPU = section.getboolean('intel_gpu', FFMPEG_USE_INTEL_GPU)
VIDEO_BITRATE = section.get('bitrate', VIDEO_BITRATE)
if config.has_section("recorder"):
global BILILIVE_RECORDER_DIRECTORY, XIGUALIVE_RECORDER_DIRECTORY
@ -90,6 +93,7 @@ def get_config():
'ffmpeg': {
'exec': FFMPEG_EXEC,
'gpu': FFMPEG_USE_GPU,
'intel_gpu': FFMPEG_USE_INTEL_GPU,
'bitrate': VIDEO_BITRATE,
},
'recorder': {