From 7f44800010cf4e5febe17785063f7617916ef657 Mon Sep 17 00:00:00 2001 From: cxh Date: Wed, 26 Nov 2025 09:52:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rtmp_manager.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/rtmp_manager.cpp b/src/rtmp_manager.cpp index c6630eb..cbfb499 100644 --- a/src/rtmp_manager.cpp +++ b/src/rtmp_manager.cpp @@ -114,19 +114,24 @@ GstElement* RTMPManager::create_pipeline(const Camera& cam) " ! mpph264enc bps=" + std::to_string(bitrate) + " gop=" + std::to_string(fps) + " rc-mode=cbr " - " ! h264parse " - " ! flvmux streamable=true name=mux " - " ! tee name=t " + " ! h264parse ! tee name=t " - "t. ! queue leaky=downstream ! rtmpsink location=\"" + + // ------ 分支1:live ------ + "t. ! queue max-size-buffers=5 leaky=downstream " + " ! flvmux streamable=true name=mux_live " + " ! rtmpsink location=\"" + live_rtmp + "\" sync=false async=false " - "t. ! queue leaky=downstream ! rtmpsink location=\"" + + // ------ 分支2:record ------ + "t. ! queue max-size-buffers=5 leaky=downstream " + " ! flvmux streamable=true name=mux_record " + " ! rtmpsink location=\"" + record_rtmp + "\" sync=false async=false " - "t. ! queue ! fakesink"; + // ------ 分支3:AI ------ + "t. ! queue ! fakesink sync=false"; GError* error = nullptr; GstElement* pipeline = gst_parse_launch(pipeline_str.c_str(), &error);