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__ from .pyarmor_runtime import __pyarmor__

View File

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