This commit is contained in:
eric
2026-01-31 21:46:18 -06:00
parent d03001d446
commit 5722f2f6b3
3 changed files with 48 additions and 49 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +1,2 @@
# Pyarmor 9.2.3 (trial), 000000, 2026-02-01T03:09:00.012105
# Pyarmor 9.2.3 (trial), 000000, 2026-01-31T21:44:12.520443
from .pyarmor_runtime import __pyarmor__

View File

@@ -196,58 +196,57 @@ def start_douyin_youtube_ffplay(
# 1080p
ffmpeg_command = [
"ffmpeg", "-y", "-loglevel", "info", "-nostdin", "-re",
"-stats", "-stats_period", "1",
"-rw_timeout", "30000000",
"-reconnect", "1", "-reconnect_at_eof", "1", "-reconnect_streamed", "1",
"-reconnect_delay_max", "5",
"-fflags", "+genpts+discardcorrupt+nobuffer+flush_packets",
"-flags", "low_delay",
"-err_detect", "ignore_err",
"-max_delay", "80000",
"-thread_queue_size", "2048",
"ffmpeg", "-y", "-loglevel", "info", "-nostdin", "-re",
"-stats", "-stats_period", "1",
"-rw_timeout", "30000000",
"-reconnect", "1", "-reconnect_at_eof", "1",
"-reconnect_streamed", "1",
"-reconnect_delay_max", "5",
"-fflags", "+genpts+discardcorrupt+nobuffer+flush_packets",
"-flags", "low_delay",
"-err_detect", "ignore_err",
"-max_delay", "80000",
"-thread_queue_size", "2048",
"-headers", douyin_headers,
"-i", real_url,
# 1080p
"-vf","fps=30,scale=1080:1920:force_original_aspect_ratio=decrease:flags=lanczos,pad=1080:1920:(ow-iw)/2:(oh-ih)/2:black",
"-c:v", "libx264",
"-preset", "veryfast",
"-tune", "zerolatency",
"-profile:v", "high",
# 1080p
"-b:v", "5200k", "-maxrate", "5800k", "-bufsize", "10400k", # 改12× bufsize真 CBR
"-vsync", "cfr",
"-g", "60", "-keyint_min", "60",
"-r", "30",
"-bf", "0",
"-sc_threshold", "0",
# "-nal-hrd", "cbr", # 改2强制 CBR
# 1080p
"-x264-params","force-cfr=1:scenecut=0:open_gop=0:sync-lookahead=0",
"-pix_fmt", "yuv420p",
"-c:a", "aac", "-b:a", "128k", "-ar", "44100", "-ac", "2",
"-af",
"arnndn=m=./arnndn-models/cb.rnnn:mix=0.88," # 人声增强
"afftdn=nf=-24:tn=1," # FFT 降噪,抹平音乐中频
"highpass=f=110,lowpass=f=4800," # 切掉低音鼓/高频镲
"equalizer=f=250:width_type=o:width=2:g=-9," # 衰减低中频,音乐基础弱化
"equalizer=f=800:width_type=o:width=1.5:g=-6," # 再衰减中频,人声外区域
"atempo=1.03," # 轻微加速 3%,节奏轻微错位
"asetrate=48000*1.02,aresample=48000," # 音高上移 ~1/2 半音
"afreqshift=shift=20," # 整体频率偏移 20Hz破坏指纹
"acompressor=threshold=-28dB:ratio=5:attack=8:release=80:makeup=5," # 压缩动态,音乐更“扁”
"volume=1.15," # 补偿整体音量
"aresample=async=1:first_pts=0" # 保证音视频同步
"-headers", douyin_headers,
"-i", real_url,
"-vf", "fps=30,scale=1080:1920:force_original_aspect_ratio=decrease:flags=lanczos,"
"pad=1080:1920:(ow-iw)/2:(oh-ih)/2:black",
"-flags", "+global_header",
"-flvflags", "no_duration_filesize",
"-f", "flv", youtube_rtmp
"-c:v", "libx264",
"-preset", "veryfast",
"-tune", "zerolatency",
"-profile:v", "high",
"-b:v", "5200k", "-maxrate", "5800k", "-bufsize", "10400k",
"-vsync", "cfr",
"-g", "60", "-keyint_min", "60",
"-r", "30",
"-bf", "0",
"-sc_threshold", "0",
"-x264-params", "force-cfr=1:scenecut=0:open_gop=0:sync-lookahead=0",
"-pix_fmt", "yuv420p",
"-c:a", "aac", "-b:a", "128k", "-ar", "44100", "-ac", "2",
"-af",
"arnndn=m=./arnndn-models/cb.rnnn:mix=0.88,"
"afftdn=nf=-24:tn=1,"
"highpass=f=110,lowpass=f=4800,"
"equalizer=f=250:width_type=o:width=2:g=-9,"
"equalizer=f=800:width_type=o:width=1.5:g=-6,"
"atempo=1.03,"
"asetrate=48000*1.02,aresample=48000,"
"afreqshift=shift=20,"
"acompressor=threshold=-28dB:ratio=5:attack=8:release=80:makeup=5,"
"volume=1.15,"
"aresample=async=1:first_pts=0",
"-flvflags", "no_duration_filesize",
"-f", "flv", youtube_rtmp
]
# ====================== 主重试循环(原样保留) ======================
proc = None
stderr_q = None