's'
This commit is contained in:
111
main.py
111
main.py
@@ -1781,44 +1781,44 @@ def start_record(url_data: tuple, count_variable: int = -1) -> None:
|
|||||||
|
|
||||||
|
|
||||||
# 1080p
|
# 1080p
|
||||||
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,
|
||||||
# 1080p
|
# # 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
|
# # 1080p
|
||||||
"-b:v", "5200k", "-maxrate", "5800k", "-bufsize", "10400k", # 改1:2× bufsize,真 CBR
|
# "-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
|
# # "-nal-hrd", "cbr", # 改2:强制 CBR
|
||||||
# 1080p
|
# # 1080p
|
||||||
"-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",
|
||||||
"-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",
|
||||||
"-flvflags", "no_duration_filesize",
|
# "-flvflags", "no_duration_filesize",
|
||||||
"-f", "flv", youtube_rtmp
|
# "-f", "flv", youtube_rtmp
|
||||||
]
|
# ]
|
||||||
|
|
||||||
|
|
||||||
# srs内网配置
|
# srs内网配置
|
||||||
@@ -1842,6 +1842,45 @@ def start_record(url_data: tuple, count_variable: int = -1) -> None:
|
|||||||
# "-f", "flv", srs_rtmp
|
# "-f", "flv", srs_rtmp
|
||||||
# ]
|
# ]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# 1080p 输出到 HDMI
|
||||||
|
ffmpeg_command = [
|
||||||
|
"ffmpeg", "-y", "-loglevel", "info", "-nostdin", "-re",
|
||||||
|
"-stats", "-stats_period", "1",
|
||||||
|
"-rw_timeout", "30000000",
|
||||||
|
"-reconnect", "1", "-reconnect_at_eof", "1", "-reconnect_streamed", "1",
|
||||||
|
"-reconnect_delay_max", "5",
|
||||||
|
"-fflags", "+genpts+discardcorrupt+nobuffer+flush_packets",
|
||||||
|
"-flags", "low_delay",
|
||||||
|
"-err_detect", "ignore_err",
|
||||||
|
"-max_delay", "80000",
|
||||||
|
"-thread_queue_size", "2048",
|
||||||
|
|
||||||
|
"-headers", douyin_headers,
|
||||||
|
"-i", real_url,
|
||||||
|
"-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",
|
||||||
|
"-preset", "veryfast",
|
||||||
|
"-tune", "zerolatency",
|
||||||
|
"-profile:v", "high",
|
||||||
|
"-b:v", "5200k", "-maxrate", "5800k", "-bufsize", "10400k",
|
||||||
|
"-vsync", "cfr",
|
||||||
|
"-g", "60", "-keyint_min", "60",
|
||||||
|
"-r", "30",
|
||||||
|
"-bf", "0",
|
||||||
|
"-sc_threshold", "0",
|
||||||
|
"-x264-params","force-cfr=1:scenecut=0:open_gop=0:sync-lookahead=0",
|
||||||
|
"-pix_fmt", "yuv420p",
|
||||||
|
"-c:a", "aac", "-b:a", "128k", "-ar", "44100", "-ac", "2",
|
||||||
|
"-af", "aresample=async=1:first_pts=0",
|
||||||
|
|
||||||
|
# HDMI 输出,SDL 会直接开窗口显示
|
||||||
|
"-f", "sdl", "HDMI"
|
||||||
|
]
|
||||||
|
|
||||||
# ---- 单层重试循环(清晰可控) ----
|
# ---- 单层重试循环(清晰可控) ----
|
||||||
proc = None
|
proc = None
|
||||||
stderr_q = None
|
stderr_q = None
|
||||||
|
|||||||
Reference in New Issue
Block a user