diff --git a/src/rtmp_manager.cpp b/src/rtmp_manager.cpp index 16a4df6..06d6e30 100644 --- a/src/rtmp_manager.cpp +++ b/src/rtmp_manager.cpp @@ -79,31 +79,22 @@ GstElement* RTMPManager::create_pipeline(const Camera& cam) std::string pipeline_str = "v4l2src device=" + cam.device + " io-mode=dmabuf " - "! video/x-raw,format=NV12," - "width=" + + "! video/x-raw,format=NV12,width=" + std::to_string(width) + ",height=" + std::to_string(height) + ",framerate=" + std::to_string(fps) + "/1 " - "! queue max-size-buffers=4 leaky=downstream " - + "! queue max-size-buffers=2 leaky=downstream " "! mpph264enc " - "profile=baseline " // ⭐ 核心:硬性禁 B 帧 - "rc-mode=cbr " "bps=" + std::to_string(bitrate) + " " "gop=" + std::to_string(fps) + - " " // 1 秒 1 个 IDR - "header-mode=each-idr " // SPS/PPS 跟 IDR - + " " + "rc-mode=cbr " + "header-mode=each-idr " "! h264parse " - "config-interval=1 " - "disable-passthrough=true " // ⭐ 修 DTS - - "! queue max-size-buffers=5 leaky=downstream " "! flvmux streamable=true " - "! rtmpsink location=\"" + live_rtmp + "\" sync=false async=false";