diff --git a/src/rtmp_manager.cpp b/src/rtmp_manager.cpp index 5aff5b1..3348566 100644 --- a/src/rtmp_manager.cpp +++ b/src/rtmp_manager.cpp @@ -81,15 +81,20 @@ GstElement* RTMPManager::create_pipeline(const Camera& cam) ",framerate=" + std::to_string(fps) + "/1 ! " "tee name=t " - "t. ! queue max-size-buffers=5 leaky=downstream ! " + // 主分支:编码 + RTMP 推流 + "t. ! queue ! " "mpph264enc bps=" + std::to_string(bitrate) + " gop=" + std::to_string(fps) + - " rc-mode=cbr ! " + " ! " "h264parse ! flvmux streamable=true name=mux " - "audiotestsrc wave=silence ! audioconvert ! audioresample ! voaacenc ! aacparse ! mux. " - "mux. ! rtmpsink location=\"" + + // 静音音频轨道(避免 RTMP 播放器报错) + "audiotestsrc wave=silence ! audioconvert ! audioresample ! " + "voaacenc ! aacparse ! mux. " + // 输出 RTMP + "mux. ! rtmpsink name=sink location=\"" + location + - "\" sync=false async=false " + "\" sync=false " + // 第二分支:预留 (AI 分析/录制) "t. ! queue ! fakesink sync=false"; GError* error = nullptr;