From 9761d13b6f8734130467d7559f671938bc211d08 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Wed, 1 Jun 2022 09:22:22 +0800 Subject: [PATCH] =?UTF-8?q?CRF=E5=AE=A2=E5=88=B6=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.py | 6 +++++- templates/index.html | 5 +++++ workflow/video.py | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/config.py b/config.py index c931d86..e3bbea5 100644 --- a/config.py +++ b/config.py @@ -20,6 +20,8 @@ FFMPEG_USE_NVIDIA_GPU = False FFMPEG_USE_INTEL_GPU = False # bitrate VIDEO_BITRATE = "2.5M" +# crf +VIDEO_CRF = 28 # [video] # title VIDEO_TITLE = "【永恒de草薙直播录播】直播于 {}" @@ -61,11 +63,12 @@ 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_NVIDIA_GPU, FFMPEG_USE_INTEL_GPU, VIDEO_BITRATE + global FFMPEG_EXEC, FFMPEG_USE_NVIDIA_GPU, FFMPEG_USE_INTEL_GPU, VIDEO_BITRATE, VIDEO_CRF FFMPEG_EXEC = section.get('exec', FFMPEG_EXEC) FFMPEG_USE_NVIDIA_GPU = section.getboolean('nvidia_gpu', FFMPEG_USE_NVIDIA_GPU) FFMPEG_USE_INTEL_GPU = section.getboolean('intel_gpu', FFMPEG_USE_INTEL_GPU) VIDEO_BITRATE = section.get('bitrate', VIDEO_BITRATE) + VIDEO_CRF = section.getfloat('crf', VIDEO_CRF) if config.has_section("recorder"): global BILILIVE_RECORDER_DIRECTORY, XIGUALIVE_RECORDER_DIRECTORY, VIDEO_OUTPUT_DIR section = config['recorder'] @@ -95,6 +98,7 @@ def get_config(): 'nvidia_gpu': FFMPEG_USE_NVIDIA_GPU, 'intel_gpu': FFMPEG_USE_INTEL_GPU, 'bitrate': VIDEO_BITRATE, + 'crf': VIDEO_CRF, }, 'recorder': { 'bili_dir': BILILIVE_RECORDER_DIRECTORY, diff --git a/templates/index.html b/templates/index.html index 55da553..cb52508 100644 --- a/templates/index.html +++ b/templates/index.html @@ -75,6 +75,10 @@