1
This commit is contained in:
parent
005529a9a0
commit
8d411c6efe
@ -96,7 +96,7 @@ GstElement *RTMPManager::create_pipeline(const Camera &cam, StreamType type)
|
|||||||
|
|
||||||
std::string stream_name = cam.name + stream_type_suffix(type);
|
std::string stream_name = cam.name + stream_type_suffix(type);
|
||||||
|
|
||||||
// ✅ 注意:只用 sync/async
|
// ✅ 加入静音音轨 (audiotestsrc wave=silence)
|
||||||
std::string pipeline_str = "v4l2src device=" + cam.device +
|
std::string pipeline_str = "v4l2src device=" + cam.device +
|
||||||
" ! video/x-raw,format=NV12,width=" + std::to_string(width) +
|
" ! video/x-raw,format=NV12,width=" + std::to_string(width) +
|
||||||
",height=" + std::to_string(height) + ",framerate=" + std::to_string(fps) +
|
",height=" + std::to_string(height) + ",framerate=" + std::to_string(fps) +
|
||||||
@ -104,10 +104,14 @@ GstElement *RTMPManager::create_pipeline(const Camera &cam, StreamType type)
|
|||||||
"! mpph264enc bps=" +
|
"! mpph264enc bps=" +
|
||||||
std::to_string(bitrate) + " gop=" + std::to_string(fps) +
|
std::to_string(bitrate) + " gop=" + std::to_string(fps) +
|
||||||
" ! h264parse config-interval=-1 "
|
" ! h264parse config-interval=-1 "
|
||||||
"! flvmux streamable=true name=mux "
|
"! flvmux name=mux streamable=true "
|
||||||
"! queue leaky=downstream max-size-buffers=0 max-size-time=2000000000 max-size-bytes=0 "
|
"! queue leaky=downstream max-size-buffers=0 max-size-time=2000000000 max-size-bytes=0 "
|
||||||
"! rtmpsink location=\"rtmp://127.0.0.1/live/" +
|
"! rtmpsink location=\"rtmp://127.0.0.1/live/" +
|
||||||
stream_name + " live=1\" sync=false async=false";
|
stream_name +
|
||||||
|
" live=1\" sync=false async=false "
|
||||||
|
// 静音音轨部分
|
||||||
|
"audiotestsrc wave=silence ! audioconvert ! audioresample "
|
||||||
|
"! voaacenc bitrate=64000 ! aacparse ! mux.";
|
||||||
|
|
||||||
LOG_INFO("[RTMP] Creating pipeline for '" + stream_name + "': " + pipeline_str);
|
LOG_INFO("[RTMP] Creating pipeline for '" + stream_name + "': " + pipeline_str);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user