1
This commit is contained in:
parent
12b793b658
commit
2b7ff4e056
@ -79,31 +79,22 @@ GstElement* RTMPManager::create_pipeline(const Camera& cam)
|
|||||||
|
|
||||||
std::string pipeline_str = "v4l2src device=" + cam.device +
|
std::string pipeline_str = "v4l2src device=" + cam.device +
|
||||||
" io-mode=dmabuf "
|
" io-mode=dmabuf "
|
||||||
"! video/x-raw,format=NV12,"
|
"! video/x-raw,format=NV12,width=" +
|
||||||
"width=" +
|
|
||||||
std::to_string(width) + ",height=" + std::to_string(height) +
|
std::to_string(width) + ",height=" + std::to_string(height) +
|
||||||
",framerate=" + std::to_string(fps) +
|
",framerate=" + std::to_string(fps) +
|
||||||
"/1 "
|
"/1 "
|
||||||
"! queue max-size-buffers=4 leaky=downstream "
|
"! queue max-size-buffers=2 leaky=downstream "
|
||||||
|
|
||||||
"! mpph264enc "
|
"! mpph264enc "
|
||||||
"profile=baseline " // ⭐ 核心:硬性禁 B 帧
|
|
||||||
"rc-mode=cbr "
|
|
||||||
"bps=" +
|
"bps=" +
|
||||||
std::to_string(bitrate) +
|
std::to_string(bitrate) +
|
||||||
" "
|
" "
|
||||||
"gop=" +
|
"gop=" +
|
||||||
std::to_string(fps) +
|
std::to_string(fps) +
|
||||||
" " // 1 秒 1 个 IDR
|
" "
|
||||||
"header-mode=each-idr " // SPS/PPS 跟 IDR
|
"rc-mode=cbr "
|
||||||
|
"header-mode=each-idr "
|
||||||
"! h264parse "
|
"! h264parse "
|
||||||
"config-interval=1 "
|
|
||||||
"disable-passthrough=true " // ⭐ 修 DTS
|
|
||||||
|
|
||||||
"! queue max-size-buffers=5 leaky=downstream "
|
|
||||||
"! flvmux streamable=true "
|
"! flvmux streamable=true "
|
||||||
|
|
||||||
"! rtmpsink location=\"" +
|
"! rtmpsink location=\"" +
|
||||||
live_rtmp + "\" sync=false async=false";
|
live_rtmp + "\" sync=false async=false";
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user