From 0ac1f0a670e8ff2099596166c27faf70da022b48 Mon Sep 17 00:00:00 2001 From: cxh Date: Mon, 22 Sep 2025 09:47:59 +0800 Subject: [PATCH] test --- src/rtsp_manager.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/rtsp_manager.cpp b/src/rtsp_manager.cpp index 041b844..6d96486 100644 --- a/src/rtsp_manager.cpp +++ b/src/rtsp_manager.cpp @@ -22,7 +22,6 @@ void RTSPManager::init() LOG_INFO("[RTSP] GStreamer initialized."); } -// 创建 media factory // 创建 media factory GstRTSPMediaFactory *RTSPManager::create_media_factory(const Camera &cam) { @@ -36,11 +35,11 @@ GstRTSPMediaFactory *RTSPManager::create_media_factory(const Camera &cam) " ! video/x-raw,format=NV12,width=" + std::to_string(out_width) + ",height=" + std::to_string(out_height) + ",framerate=" + std::to_string(cam.fps) + "/1" - " ! queue max-size-buffers=2 leaky=downstream" - " ! mpph264enc bps=2000000 gop=" + - std::to_string(cam.fps) + - " ! h264parse" - " ! rtph264pay name=pay0 pt=96 config-interval=1 )"; + " ! queue max-size-buffers=1 leaky=downstream" // 最小队列 + " ! mpph264enc bps=4000000 gop=" + + std::to_string(cam.fps) + " " // 固定 4Mbps + " ! h264parse" + " ! rtph264pay name=pay0 pt=96 config-interval=1 )"; // 每秒发送 SPS/PPS GstRTSPMediaFactory *factory = gst_rtsp_media_factory_new(); gst_rtsp_media_factory_set_launch(factory, launch_str.c_str());