This commit is contained in:
cxh 2025-11-26 09:52:34 +08:00
parent 8d281527d4
commit 7f44800010

View File

@ -114,19 +114,24 @@ GstElement* RTMPManager::create_pipeline(const Camera& cam)
" ! mpph264enc bps=" + " ! mpph264enc bps=" +
std::to_string(bitrate) + " gop=" + std::to_string(fps) + std::to_string(bitrate) + " gop=" + std::to_string(fps) +
" rc-mode=cbr " " rc-mode=cbr "
" ! h264parse " " ! h264parse ! tee name=t "
" ! flvmux streamable=true name=mux "
" ! tee name=t "
"t. ! queue leaky=downstream ! rtmpsink location=\"" + // ------ 分支1live ------
"t. ! queue max-size-buffers=5 leaky=downstream "
" ! flvmux streamable=true name=mux_live "
" ! rtmpsink location=\"" +
live_rtmp + live_rtmp +
"\" sync=false async=false " "\" sync=false async=false "
"t. ! queue leaky=downstream ! rtmpsink location=\"" + // ------ 分支2record ------
"t. ! queue max-size-buffers=5 leaky=downstream "
" ! flvmux streamable=true name=mux_record "
" ! rtmpsink location=\"" +
record_rtmp + record_rtmp +
"\" sync=false async=false " "\" sync=false async=false "
"t. ! queue ! fakesink"; // ------ 分支3AI ------
"t. ! queue ! fakesink sync=false";
GError* error = nullptr; GError* error = nullptr;
GstElement* pipeline = gst_parse_launch(pipeline_str.c_str(), &error); GstElement* pipeline = gst_parse_launch(pipeline_str.c_str(), &error);