This commit is contained in:
eric
2026-03-19 03:51:16 -05:00
parent fd3d952ab8
commit 219a8cef61
2 changed files with 5 additions and 5 deletions

View File

@@ -5,5 +5,5 @@ key = x04z-564w-aks7-embw-30y4
# 可选:是否使用 RTMPS 加密推流,填 否 则用 RTMP默认 RTMPS # 可选:是否使用 RTMPS 加密推流,填 否 则用 RTMP默认 RTMPS
; rtmps = 否 ; rtmps = 否
# 可选:视频比特率 kbps720p 推荐 4000-6000YouTube 官方 4-6 Mbps # 可选:视频比特率 kbpsYouTube 推荐 2500可填 3000-4500 提高画质
; bitrate = 4500 ; bitrate = 2500

View File

@@ -84,7 +84,7 @@ def start_douyin_youtube_ffplay(
rtmps_base = "rtmps://a.rtmp.youtube.com/live2/" rtmps_base = "rtmps://a.rtmp.youtube.com/live2/"
rtmp_base = "rtmp://a.rtmp.youtube.com/live2/" rtmp_base = "rtmp://a.rtmp.youtube.com/live2/"
use_rtmps = True use_rtmps = True
b_v, maxrate, bufsize = "4500k", "5500k", "9000k" b_v, maxrate, bufsize = "2500k", "3000k", "5000k"
stream_key = None stream_key = None
if os.path.exists(config_file): if os.path.exists(config_file):
@@ -165,8 +165,8 @@ def start_douyin_youtube_ffplay(
if "h264_nvenc" in (enc.stdout or ""): if "h264_nvenc" in (enc.stdout or ""):
codec_v = "h264_nvenc" codec_v = "h264_nvenc"
video_args = ["-profile:v", "high", "-level", "4.0", video_args = ["-profile:v", "high", "-level", "4.0",
"-tune", "ll", "-rc", "vbr", "-cq", "24", "-tune", "ll", "-rc", "cbr", "-b:v", b_v,
"-b:v", b_v, "-maxrate", maxrate, "-bufsize", bufsize] "-maxrate", maxrate, "-bufsize", bufsize]
print("[INFO] 检测到 NVIDIA GPU → 使用 NVENC 硬件加速") print("[INFO] 检测到 NVIDIA GPU → 使用 NVENC 硬件加速")
except Exception as e: except Exception as e:
print(f"[WARN] NVENC 检测失败,回退软件编码: {e}") print(f"[WARN] NVENC 检测失败,回退软件编码: {e}")