diff --git a/douyin_youtube_ffplay.py b/douyin_youtube_ffplay.py index f63551f..f528b7a 100644 --- a/douyin_youtube_ffplay.py +++ b/douyin_youtube_ffplay.py @@ -196,7 +196,8 @@ def start_douyin_youtube_ffplay( -# 720p-处理背景音(低 CPU + Content ID 防护优化版) + +# 720p-低CPU + 背景音乐处理 + 防ContentID ffmpeg_command = [ "ffmpeg", "-y", "-loglevel", "info", "-nostdin", "-re", "-stats", "-stats_period", "1", @@ -218,29 +219,30 @@ def start_douyin_youtube_ffplay( "pad=720:1280:(ow-iw)/2:(oh-ih)/2:black", "-c:v", "libx264", - "-preset", "veryfast", # 降低 CPU 压力 + "-preset", "veryfast", # 降低CPU "-profile:v", "high", "-b:v", "2600k", "-maxrate", "3000k", "-bufsize", "5200k", "-vsync", "cfr", - "-g", "50", "-keyint_min", "50", # 与 fps=25 对应 + "-g", "50", "-keyint_min", "50", # 与fps=25匹配 "-r", "25", "-bf", "0", "-sc_threshold", "0", "-x264-params", "force-cfr=1:scenecut=0:open_gop=0:sync-lookahead=0", "-pix_fmt", "yuv420p", - # 音频处理(轻量版 + 防 Content ID) + # 音频处理(轻量 + 背景音乐弱化 + 防Content ID) "-c:a", "aac", "-b:a", "128k", "-ar", "48000", "-ac", "2", "-af", - "afftdn=nf=-28:tn=1," # 轻 FFT 降噪 - "highpass=f=120,lowpass=f=5000," # 切低频鼓 & 高频镲 - "equalizer=f=250:width_type=o:width=2:g=-6," # 音乐低频基础 - "equalizer=f=900:width_type=o:width=1.2:g=-4,"# 音乐旋律区轻弱化 - "acompressor=threshold=-32dB:ratio=3.5:attack=12:release=150:makeup=3," # 压动态 - "asetrate=48000*1.02,aresample=48000," # 音高上移 1/2 半音 - "afreqshift=shift=15," # 小幅频率偏移 - "volume=1.05," # 音量补偿 - "aresample=async=1:first_pts=0", # 保证音视频同步 + "arnndn=m=./arnndn-models/cb.rnnn:mix=0.85," # 人声增强 + "afftdn=nf=-28:tn=1," # 轻 FFT 降噪,背景弱化 + "highpass=f=120,lowpass=f=4800," # 切低频鼓 & 高频镲 + "equalizer=f=250:width_type=o:width=2:g=-8," # 衰减低中频 + "equalizer=f=800:width_type=o:width=1.5:g=-5," # 衰减中频 + "acompressor=threshold=-30dB:ratio=4:attack=10:release=100:makeup=4," # 压动态 + "asetrate=48000*1.02,aresample=48000," # 音高微升 + "afreqshift=shift=15," # 小幅频率偏移 + "volume=1.1," # 音量补偿 + "aresample=async=1:first_pts=0", # 音视频同步 # 推流参数 "-flvflags", "no_duration_filesize", @@ -251,6 +253,7 @@ def start_douyin_youtube_ffplay( + # 1080p # ffmpeg_command = [ # "ffmpeg", "-y", "-loglevel", "info", "-nostdin", "-re",