This commit is contained in:
cxh 2025-10-16 17:03:32 +08:00
parent 17f9753906
commit 0907b04ca0

View File

@ -103,7 +103,10 @@ GstElement *RTMPManager::create_pipeline(const Camera &cam, StreamType type)
std::to_string(bitrate) + " gop=" + std::to_string(fps) + std::to_string(bitrate) + " gop=" + std::to_string(fps) +
" ! h264parse ! flvmux streamable=true name=mux " " ! h264parse ! flvmux streamable=true name=mux "
"! rtmpsink location=\"rtmp://127.0.0.1/live/" + "! rtmpsink location=\"rtmp://127.0.0.1/live/" +
stream_name + " live=1\" sync=false"; stream_name +
" live=1\" sync=false"
"timeout=5000000 " // 5秒超时微秒单位
"async-handling=true"; // 异步错误处理,防止阻塞
LOG_INFO("[RTMP] Creating pipeline for '" + stream_name + "': " + pipeline_str); LOG_INFO("[RTMP] Creating pipeline for '" + stream_name + "': " + pipeline_str);