From 0e8cbba577b71975497d69312bad62cdd2c30079 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Thu, 9 Feb 2023 02:26:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E4=BD=BF=E7=94=A8CRF?= =?UTF-8?q?=EF=BC=8Cnvenc=E5=8E=8B=E5=88=B6=E6=97=B6=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E7=94=A8slowest=E9=A2=84=E8=AE=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.py | 10 +++++----- templates/index.html | 6 +++--- workflow/video.py | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/config.py b/config.py index 41dadd6..b229247 100644 --- a/config.py +++ b/config.py @@ -28,8 +28,8 @@ FFMPEG_USE_NVIDIA_GPU = False FFMPEG_USE_INTEL_GPU = False # vaapi FFMPEG_USE_VAAPI = False -# bitrate -VIDEO_BITRATE = "2.5M" +# crf +VIDEO_CRF = 28 # gop VIDEO_GOP = 60 # [video] @@ -94,14 +94,14 @@ 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_HEVC, FFMPEG_USE_NVIDIA_GPU, FFMPEG_USE_INTEL_GPU, VIDEO_BITRATE, \ + global FFMPEG_EXEC, FFMPEG_USE_HEVC, FFMPEG_USE_NVIDIA_GPU, FFMPEG_USE_INTEL_GPU, VIDEO_CRF, \ VIDEO_GOP, FFMPEG_USE_VAAPI FFMPEG_EXEC = section.get('exec', FFMPEG_EXEC) FFMPEG_USE_HEVC = section.getboolean('hevc', FFMPEG_USE_HEVC) FFMPEG_USE_NVIDIA_GPU = section.getboolean('nvidia_gpu', FFMPEG_USE_NVIDIA_GPU) FFMPEG_USE_INTEL_GPU = section.getboolean('intel_gpu', FFMPEG_USE_INTEL_GPU) FFMPEG_USE_VAAPI = section.getboolean('vaapi', FFMPEG_USE_VAAPI) - VIDEO_BITRATE = section.get('bitrate', VIDEO_BITRATE) + VIDEO_CRF = section.getfloat('crf', VIDEO_CRF) VIDEO_GOP = section.getfloat('gop', VIDEO_GOP) if config.has_section("recorder"): global BILILIVE_RECORDER_DIRECTORY, XIGUALIVE_RECORDER_DIRECTORY, VIDEO_OUTPUT_DIR @@ -140,7 +140,7 @@ def get_config(): 'nvidia_gpu': FFMPEG_USE_NVIDIA_GPU, 'intel_gpu': FFMPEG_USE_INTEL_GPU, 'vaapi': FFMPEG_USE_VAAPI, - 'bitrate': VIDEO_BITRATE, + 'crf': VIDEO_CRF, 'gop': VIDEO_GOP, }, 'recorder': { diff --git a/templates/index.html b/templates/index.html index b5bc675..d817d37 100644 --- a/templates/index.html +++ b/templates/index.html @@ -101,8 +101,8 @@