's'
This commit is contained in:
45
main.py
45
main.py
@@ -1671,21 +1671,18 @@ def start_record(url_data: tuple, count_variable: int = -1) -> None:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
# ========== 参数配置(保留你原始配置) ==========
|
# ========== 参数配置(保留你原始配置) ==========
|
||||||
YT_STREAM_KEY = "qxvb-r47b-r5ju-6ud3-6k7z"
|
# YT_STREAM_KEY = "qxvb-r47b-r5ju-6ud3-6k7z"
|
||||||
youtube_rtmp = f"rtmp://a.rtmp.youtube.com/live2/qxvb-r47b-r5ju-6ud3-6k7z"
|
youtube_rtmp = f"rtmp://a.rtmp.youtube.com/live2/qxvb-r47b-r5ju-6ud3-6k7z"
|
||||||
# youtube_rtmp="rtmp://192.168.31.184/live/douyin"
|
# youtube_rtmp="rtmp://192.168.31.184/live/douyin"
|
||||||
|
|
||||||
# ←←←← 在这块代码的上方先定义你要推的多个地址 ←←←←
|
# # ←←←← 在这块代码的上方先定义你要推的多个地址 ←←←←
|
||||||
rtmp_targets = [
|
# rtmp_targets = [
|
||||||
"rtmp://a.rtmp.youtube.com/live2/qxvb-r47b-r5ju-6ud3-6k7z", # 主频道
|
# "rtmp://a.rtmp.youtube.com/live2/qxvb-r47b-r5ju-6ud3-6k7z", # 主频道
|
||||||
"rtmp://192.168.31.184/live/douyin", # 备用频道(换成你的第二个 YouTube 密钥)
|
# "rtmp://192.168.31.184/live/douyin", # 备用频道(换成你的第二个 YouTube 密钥)
|
||||||
# "rtmp://live-push.bilibili.com/live/xxx?streamkey=xxx", # B站示例
|
# ]
|
||||||
# "rtmp://ingest.twitch.tv/ingest/xxxxxxx", # Twitch 示例
|
|
||||||
# 想推几个就加几个
|
|
||||||
]
|
|
||||||
|
|
||||||
# 用 | 拼接所有地址(任何一个断开都不会影响其他)
|
# # 用 | 拼接所有地址(任何一个断开都不会影响其他)
|
||||||
tee_outputs = "|".join([f"[f=flv:onfail=ignore]{url}" for url in rtmp_targets])
|
# tee_outputs = "|".join([f"[f=flv]{url}" for url in rtmp_targets])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1735,7 +1732,6 @@ def start_record(url_data: tuple, count_variable: int = -1) -> None:
|
|||||||
"Referer: https://live.douyin.com/\r\n"
|
"Referer: https://live.douyin.com/\r\n"
|
||||||
"Origin: https://live.douyin.com\r\n"
|
"Origin: https://live.douyin.com\r\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
ffmpeg_command = [
|
ffmpeg_command = [
|
||||||
"ffmpeg", "-loglevel", "info",
|
"ffmpeg", "-loglevel", "info",
|
||||||
"-rw_timeout", "15000000",
|
"-rw_timeout", "15000000",
|
||||||
@@ -1753,12 +1749,29 @@ def start_record(url_data: tuple, count_variable: int = -1) -> None:
|
|||||||
"-c:a", "aac", "-b:a", "128k", "-ar", "44100", "-ac", "2",
|
"-c:a", "aac", "-b:a", "128k", "-ar", "44100", "-ac", "2",
|
||||||
"-af", "aresample=async=1:first_pts=0",
|
"-af", "aresample=async=1:first_pts=0",
|
||||||
"-flags", "+global_header",
|
"-flags", "+global_header",
|
||||||
# "-f", "flv", youtube_rtmp
|
"-f", "flv", youtube_rtmp
|
||||||
"-f", "tee",
|
# "-f", "tee",
|
||||||
"-map", "0:v", "-map", "0:a",
|
# "-map", "0:v", "-map", "0:a",
|
||||||
tee_outputs
|
# tee_outputs
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
# srs内网配置
|
||||||
|
# ffmpeg_command = [
|
||||||
|
# "ffmpeg", "-loglevel", "warning",
|
||||||
|
# "-err_detect", "ignore_err+explode",
|
||||||
|
# "-fflags", "+genpts+discardcorrupt+igndts",
|
||||||
|
# "-reconnect", "1", "-reconnect_at_eof", "1", "-reconnect_streamed", "1",
|
||||||
|
# "-reconnect_delay_max", "7",
|
||||||
|
# "-rw_timeout", "30000000",
|
||||||
|
# "-headers", douyin_headers,
|
||||||
|
# "-i", real_url,
|
||||||
|
# "-re", "-copyts", "-avoid_negative_ts", "disabled",
|
||||||
|
# "-max_muxing_queue_size", "9999",
|
||||||
|
# "-c:v", "copy", "-c:a", "copy",
|
||||||
|
# "-f", "flv", youtube_rtmp
|
||||||
|
# ]
|
||||||
|
|
||||||
# ---- 单层重试循环(清晰可控) ----
|
# ---- 单层重试循环(清晰可控) ----
|
||||||
proc = None
|
proc = None
|
||||||
stderr_q = None
|
stderr_q = None
|
||||||
|
|||||||
Reference in New Issue
Block a user