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