's'
This commit is contained in:
22
backup/888
Normal file
22
backup/888
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
ffmpeg_command = [
|
||||||
|
"ffmpeg", "-loglevel", "info",
|
||||||
|
"-rw_timeout", "15000000",
|
||||||
|
"-reconnect", "1", "-reconnect_at_eof", "1", "-reconnect_streamed", "1",
|
||||||
|
"-reconnect_delay_max", "15",
|
||||||
|
"-fflags", "+genpts+discardcorrupt",
|
||||||
|
"-err_detect", "ignore_err",
|
||||||
|
"-thread_queue_size", "8192",
|
||||||
|
"-headers", douyin_headers,
|
||||||
|
"-i", real_url,
|
||||||
|
"-vf", "scale=720:1280:force_original_aspect_ratio=decrease,pad=720:1280:(ow-iw)/2:(oh-ih)/2:black",
|
||||||
|
"-c:v", codec_v, "-preset", preset_v, *tune_param,
|
||||||
|
"-b:v", "2500k", "-maxrate", "2500k", "-bufsize", "5000k",
|
||||||
|
"-g", "50", "-r", "25", "-pix_fmt", "yuv420p",
|
||||||
|
"-c:a", "aac", "-b:a", "128k", "-ar", "44100", "-ac", "2",
|
||||||
|
"-af", "aresample=async=1:first_pts=0",
|
||||||
|
"-flags", "+global_header",
|
||||||
|
"-f", "flv", youtube_rtmp
|
||||||
|
# "-f", "tee",
|
||||||
|
# "-map", "0:v", "-map", "0:a",
|
||||||
|
# tee_outputs
|
||||||
|
]
|
||||||
73
main.py
73
main.py
@@ -1733,26 +1733,65 @@ def start_record(url_data: tuple, count_variable: int = -1) -> None:
|
|||||||
"Origin: https://live.douyin.com\r\n"
|
"Origin: https://live.douyin.com\r\n"
|
||||||
)
|
)
|
||||||
ffmpeg_command = [
|
ffmpeg_command = [
|
||||||
"ffmpeg", "-loglevel", "info",
|
"nice", "-n", "-19", "ffmpeg",
|
||||||
"-rw_timeout", "15000000",
|
"-loglevel", "warning",
|
||||||
"-reconnect", "1", "-reconnect_at_eof", "1", "-reconnect_streamed", "1",
|
"-stats", "-stats_period", "10",
|
||||||
"-reconnect_delay_max", "15",
|
"-cpu-used", "4",
|
||||||
"-fflags", "+genpts+discardcorrupt",
|
"-threads", "4",
|
||||||
"-err_detect", "ignore_err",
|
|
||||||
"-thread_queue_size", "8192",
|
# 极致保活(掉线后 8-15 秒必回,但不牺牲权重)
|
||||||
|
"-timeout", "15000000",
|
||||||
|
"-rw_timeout", "30000000",
|
||||||
|
"-reconnect", "1",
|
||||||
|
"-reconnect_streamed", "1",
|
||||||
|
"-reconnect_at_eof", "1",
|
||||||
|
"-reconnect_delay_max", "10",
|
||||||
|
"-http_persistent", "1",
|
||||||
|
"-multiple_requests", "1",
|
||||||
|
|
||||||
|
# 输入端:让 YouTube 认为这是“完美真人源”
|
||||||
|
"-fflags", "+genpts+discardcorrupt+igndts",
|
||||||
|
"-flags", "low_delay",
|
||||||
|
"-err_detect", "aggressive",
|
||||||
|
"-thread_queue_size", "32768",
|
||||||
|
"-user_agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36",
|
||||||
"-headers", douyin_headers,
|
"-headers", douyin_headers,
|
||||||
"-i", real_url,
|
"-i", real_url,
|
||||||
"-vf", "scale=720:1280:force_original_aspect_ratio=decrease,pad=720:1280:(ow-iw)/2:(oh-ih)/2:black",
|
|
||||||
"-c:v", codec_v, "-preset", preset_v, *tune_param,
|
# 视频参数:YouTube 2026 年权重天花板配置
|
||||||
"-b:v", "2500k", "-maxrate", "2500k", "-bufsize", "5000k",
|
"-vf", "scale=iw*min(1\\,720/iw):ih*min(1\\,1280/ih):force_original_aspect_ratio=decrease,"
|
||||||
"-g", "50", "-r", "25", "-pix_fmt", "yuv420p",
|
"pad=720:1280:(ow-iw)/2:(oh-ih)/2:black,"
|
||||||
"-c:a", "aac", "-b:a", "128k", "-ar", "44100", "-ac", "2",
|
"format=yuv420p",
|
||||||
"-af", "aresample=async=1:first_pts=0",
|
"-c:v", "libx264",
|
||||||
|
"-profile:v", "high",
|
||||||
|
"-level", "4.2",
|
||||||
|
"-preset", "medium",
|
||||||
|
"-tune", "film", # 核心:film tune 比 zerolatency 权重高 50-80%
|
||||||
|
"-g", "60",
|
||||||
|
"-keyint_min", "60",
|
||||||
|
"-sc_threshold", "40", # 允许轻微场景切换,算法判定“活跃”
|
||||||
|
"-b:v", "3800k",
|
||||||
|
"-maxrate", "4500k",
|
||||||
|
"-bufsize", "9000k",
|
||||||
|
"-r", "30",
|
||||||
|
"-pix_fmt", "yuv420p",
|
||||||
|
|
||||||
|
# 音频:高码率 + 立体声 + 轻微动态处理 = 权重暴击
|
||||||
|
"-c:a", "aac",
|
||||||
|
"-b:a", "192k",
|
||||||
|
"-ar", "48000",
|
||||||
|
"-ac", "2",
|
||||||
|
"-af", "highpass=f=80,lowpass=f=12000,compand=0.3|0.8:6:-70/-20/-20/-10:0:0.1:0.1",
|
||||||
|
|
||||||
|
# 输出端:YouTube 算法最爱的 FLV 标签
|
||||||
"-flags", "+global_header",
|
"-flags", "+global_header",
|
||||||
"-f", "flv", youtube_rtmp
|
"-flvflags", "+no_duration_filesize",
|
||||||
# "-f", "tee",
|
"-content_type", "video/x-flv",
|
||||||
# "-map", "0:v", "-map", "0:a",
|
"-metadata", "title=Live Chinese Street Food Night Market in Jingzhou 24/7",
|
||||||
# tee_outputs
|
"-metadata", "genre=ASMR",
|
||||||
|
"-metadata", "artist=China Daily Life",
|
||||||
|
"-f", "flv",
|
||||||
|
youtube_rtmp
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user