test
This commit is contained in:
parent
997c9155b8
commit
0ac1f0a670
@ -22,7 +22,6 @@ void RTSPManager::init()
|
|||||||
LOG_INFO("[RTSP] GStreamer initialized.");
|
LOG_INFO("[RTSP] GStreamer initialized.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建 media factory
|
|
||||||
// 创建 media factory
|
// 创建 media factory
|
||||||
GstRTSPMediaFactory *RTSPManager::create_media_factory(const Camera &cam)
|
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) +
|
" ! video/x-raw,format=NV12,width=" + std::to_string(out_width) +
|
||||||
",height=" + std::to_string(out_height) +
|
",height=" + std::to_string(out_height) +
|
||||||
",framerate=" + std::to_string(cam.fps) + "/1"
|
",framerate=" + std::to_string(cam.fps) + "/1"
|
||||||
" ! queue max-size-buffers=2 leaky=downstream"
|
" ! queue max-size-buffers=1 leaky=downstream" // 最小队列
|
||||||
" ! mpph264enc bps=2000000 gop=" +
|
" ! mpph264enc bps=4000000 gop=" +
|
||||||
std::to_string(cam.fps) +
|
std::to_string(cam.fps) + " " // 固定 4Mbps
|
||||||
" ! h264parse"
|
" ! h264parse"
|
||||||
" ! rtph264pay name=pay0 pt=96 config-interval=1 )";
|
" ! rtph264pay name=pay0 pt=96 config-interval=1 )"; // 每秒发送 SPS/PPS
|
||||||
|
|
||||||
GstRTSPMediaFactory *factory = gst_rtsp_media_factory_new();
|
GstRTSPMediaFactory *factory = gst_rtsp_media_factory_new();
|
||||||
gst_rtsp_media_factory_set_launch(factory, launch_str.c_str());
|
gst_rtsp_media_factory_set_launch(factory, launch_str.c_str());
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user