优化管线
This commit is contained in:
parent
9dde95485e
commit
fe68f9af7a
@ -81,15 +81,20 @@ GstElement* RTMPManager::create_pipeline(const Camera& cam)
|
|||||||
",framerate=" + std::to_string(fps) +
|
",framerate=" + std::to_string(fps) +
|
||||||
"/1 ! "
|
"/1 ! "
|
||||||
"tee name=t "
|
"tee name=t "
|
||||||
"t. ! queue max-size-buffers=5 leaky=downstream ! "
|
// 主分支:编码 + RTMP 推流
|
||||||
|
"t. ! queue ! "
|
||||||
"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 ! "
|
" ! "
|
||||||
"h264parse ! flvmux streamable=true name=mux "
|
"h264parse ! flvmux streamable=true name=mux "
|
||||||
"audiotestsrc wave=silence ! audioconvert ! audioresample ! voaacenc ! aacparse ! mux. "
|
// 静音音频轨道(避免 RTMP 播放器报错)
|
||||||
"mux. ! rtmpsink location=\"" +
|
"audiotestsrc wave=silence ! audioconvert ! audioresample ! "
|
||||||
|
"voaacenc ! aacparse ! mux. "
|
||||||
|
// 输出 RTMP
|
||||||
|
"mux. ! rtmpsink name=sink location=\"" +
|
||||||
location +
|
location +
|
||||||
"\" sync=false async=false "
|
"\" sync=false "
|
||||||
|
// 第二分支:预留 (AI 分析/录制)
|
||||||
"t. ! queue ! fakesink sync=false";
|
"t. ! queue ! fakesink sync=false";
|
||||||
|
|
||||||
GError* error = nullptr;
|
GError* error = nullptr;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user