This commit is contained in:
cxh 2025-12-29 14:15:18 +08:00
parent ee0f84304b
commit 12b793b658

View File

@ -85,22 +85,25 @@ GstElement* RTMPManager::create_pipeline(const Camera& cam)
",framerate=" + std::to_string(fps) +
"/1 "
"! queue max-size-buffers=4 leaky=downstream "
"! mpph264enc "
"profile=baseline " // ⭐ 关键:别用 high
"bframes=0 " // ⭐ 关键:禁 B 帧
"gop=" +
std::to_string(fps) +
" "
"profile=baseline " // ⭐ 核心:硬性禁 B 帧
"rc-mode=cbr "
"bps=" +
std::to_string(bitrate) +
" "
"header-mode=each-idr "
"gop=" +
std::to_string(fps) +
" " // 1 秒 1 个 IDR
"header-mode=each-idr " // SPS/PPS 跟 IDR
"! h264parse "
"config-interval=1 "
"disable-passthrough=true "
"disable-passthrough=true " // ⭐ 修 DTS
"! queue max-size-buffers=5 leaky=downstream "
"! flvmux streamable=true "
"! rtmpsink location=\"" +
live_rtmp + "\" sync=false async=false";