This commit is contained in:
cxh 2025-09-11 15:50:37 +08:00
parent f62fbe974b
commit 9d39aa14d3

View File

@ -30,7 +30,12 @@ GstRTSPMediaFactory *RTSPManager::create_media_factory(const Camera &cam)
" ! video/x-raw,format=NV12,width=" + std::to_string(cam.width) +
",height=" + std::to_string(cam.height) +
",framerate=" + std::to_string(cam.fps) + "/1"
" ! videoconvert ! queue ! mpph264enc ! rtph264pay name=pay0 pt=96 )";
" ! queue max-size-buffers=4 leaky=2" // 新增 queue防止阻塞
" ! videoconvert"
" ! video/x-raw,format=NV12" // 固定转换后的格式
" ! queue max-size-buffers=4 leaky=2" // 再加一层 queue隔离 mpph264enc
" ! mpph264enc"
" ! rtph264pay name=pay0 pt=96 )";
GstRTSPMediaFactory *factory = gst_rtsp_media_factory_new();
gst_rtsp_media_factory_set_launch(factory, launch_str.c_str());