This commit is contained in:
eric
2026-02-28 07:16:16 -06:00
parent 0e8f1947ee
commit 93874a5c0e

View File

@@ -198,55 +198,55 @@ def start_douyin_youtube_ffplay(
# "arnndn=m=./arnndn-models/cb.rnnn:mix=0.85," # 人声增强 # "arnndn=m=./arnndn-models/cb.rnnn:mix=0.85," # 人声增强
# 720p-低CPU + 背景音乐处理 + 防ContentID # 720p-低CPU + 背景音乐处理 + 防ContentID
ffmpeg_command = [ # ffmpeg_command = [
"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",
"-err_detect", "ignore_err", # "-err_detect", "ignore_err",
"-max_delay", "80000", # "-max_delay", "80000",
"-thread_queue_size", "2048", # "-thread_queue_size", "2048",
"-headers", douyin_headers, # "-headers", douyin_headers,
"-i", real_url, # "-i", real_url,
# 视频处理 720p # # 视频处理 720p
"-vf", # "-vf",
"fps=25,scale=720:1280:force_original_aspect_ratio=decrease:flags=bicubic," # "fps=25,scale=720:1280:force_original_aspect_ratio=decrease:flags=bicubic,"
"pad=720:1280:(ow-iw)/2:(oh-ih)/2:black", # "pad=720:1280:(ow-iw)/2:(oh-ih)/2:black",
"-c:v", "libx264", # "-c:v", "libx264",
"-preset", "veryfast", # 降低CPU # "-preset", "veryfast", # 降低CPU
"-profile:v", "high", # "-profile:v", "high",
"-b:v", "2600k", "-maxrate", "3000k", "-bufsize", "5200k", # "-b:v", "2600k", "-maxrate", "3000k", "-bufsize", "5200k",
"-vsync", "cfr", # "-vsync", "cfr",
"-g", "50", "-keyint_min", "50", # 与fps=25匹配 # "-g", "50", "-keyint_min", "50", # 与fps=25匹配
"-r", "25", # "-r", "25",
"-bf", "0", # "-bf", "0",
"-sc_threshold", "0", # "-sc_threshold", "0",
"-x264-params", "force-cfr=1:scenecut=0:open_gop=0:sync-lookahead=0", # "-x264-params", "force-cfr=1:scenecut=0:open_gop=0:sync-lookahead=0",
"-pix_fmt", "yuv420p", # "-pix_fmt", "yuv420p",
# 音频处理(轻量 + 背景音乐弱化 + 防Content ID) # # 音频处理(轻量 + 背景音乐弱化 + 防Content ID)
"-c:a", "aac", "-b:a", "128k", "-ar", "48000", "-ac", "2", # "-c:a", "aac", "-b:a", "128k", "-ar", "48000", "-ac", "2",
"-af", # "-af",
"afftdn=nf=-28:tn=1," # 轻 FFT 降噪,背景弱化 # "afftdn=nf=-28:tn=1," # 轻 FFT 降噪,背景弱化
"highpass=f=120,lowpass=f=4800," # 切低频鼓 & 高频镲 # "highpass=f=120,lowpass=f=4800," # 切低频鼓 & 高频镲
"equalizer=f=250:width_type=o:width=2:g=-8," # 衰减低中频 # "equalizer=f=250:width_type=o:width=2:g=-8," # 衰减低中频
"equalizer=f=800:width_type=o:width=1.5:g=-5," # 衰减中频 # "equalizer=f=800:width_type=o:width=1.5:g=-5," # 衰减中频
"acompressor=threshold=-30dB:ratio=4:attack=10:release=100:makeup=4," # 压动态 # "acompressor=threshold=-30dB:ratio=4:attack=10:release=100:makeup=4," # 压动态
"asetrate=48000*1.02,aresample=48000," # 音高微升 # "asetrate=48000*1.02,aresample=48000," # 音高微升
"afreqshift=shift=15," # 小幅频率偏移 # "afreqshift=shift=15," # 小幅频率偏移
"volume=1.1," # 音量补偿 # "volume=1.1," # 音量补偿
"aresample=async=1:first_pts=0", # 音视频同步 # "aresample=async=1:first_pts=0", # 音视频同步
# 推流参数 # # 推流参数
"-flvflags", "no_duration_filesize", # "-flvflags", "no_duration_filesize",
"-f", "flv", youtube_rtmp # "-f", "flv", youtube_rtmp
] # ]