修改管线,去掉不支持的参数
This commit is contained in:
parent
389de678f9
commit
69f8196872
@ -73,7 +73,7 @@ GstElement* RTMPManager::create_pipeline(const Camera& cam)
|
|||||||
|
|
||||||
const std::string record_rtmp = "rtmp://127.0.0.1:2935/" + app + "/" + stream + "?vhost=record";
|
const std::string record_rtmp = "rtmp://127.0.0.1:2935/" + app + "/" + stream + "?vhost=record";
|
||||||
|
|
||||||
std::string pipeline_str = "v4l2src name=src device=" + cam.device +
|
std::string pipeline_str = "v4l2src device=" + cam.device +
|
||||||
" io-mode=dmabuf "
|
" io-mode=dmabuf "
|
||||||
"! video/x-raw,format=NV12,width=1920,height=1080,framerate=" +
|
"! video/x-raw,format=NV12,width=1920,height=1080,framerate=" +
|
||||||
std::to_string(cam.fps) +
|
std::to_string(cam.fps) +
|
||||||
@ -81,6 +81,7 @@ GstElement* RTMPManager::create_pipeline(const Camera& cam)
|
|||||||
"! videoscale "
|
"! videoscale "
|
||||||
"! video/x-raw,width=" +
|
"! video/x-raw,width=" +
|
||||||
std::to_string(cam.width) + ",height=" + std::to_string(cam.height) +
|
std::to_string(cam.width) + ",height=" + std::to_string(cam.height) +
|
||||||
|
" "
|
||||||
"! queue max-size-buffers=2 leaky=downstream "
|
"! queue max-size-buffers=2 leaky=downstream "
|
||||||
"! mpph264enc rc-mode=cbr bps=" +
|
"! mpph264enc rc-mode=cbr bps=" +
|
||||||
std::to_string(cam.bitrate) + " gop=" + std::to_string(cam.fps) +
|
std::to_string(cam.bitrate) + " gop=" + std::to_string(cam.fps) +
|
||||||
@ -88,20 +89,20 @@ GstElement* RTMPManager::create_pipeline(const Camera& cam)
|
|||||||
"! h264parse config-interval=1 "
|
"! h264parse config-interval=1 "
|
||||||
"! tee name=t "
|
"! tee name=t "
|
||||||
|
|
||||||
// ========= 录像(永远启用)============
|
// ===== record:永远稳定 =====
|
||||||
"t. ! queue max-size-buffers=8 leaky=downstream "
|
"t. ! queue max-size-buffers=8 leaky=downstream "
|
||||||
"! flvmux name=rec_mux streamable=true "
|
"! flvmux name=rec_mux streamable=true "
|
||||||
"! rtmpsink name=rec_sink location=\"" +
|
"! rtmpsink name=rec_sink location=\"" +
|
||||||
record_rtmp +
|
record_rtmp +
|
||||||
"\" sync=false async=false drop-on-latency=true "
|
"\" sync=false async=false "
|
||||||
|
|
||||||
// ========= live(valve 控制)===========
|
// ===== live:可随意开关 =====
|
||||||
"t. ! queue max-size-buffers=8 leaky=downstream "
|
"t. ! queue max-size-buffers=8 leaky=downstream "
|
||||||
"! valve name=live_valve drop=true "
|
"! valve name=live_valve drop=true "
|
||||||
"! queue max-size-buffers=8 leaky=downstream "
|
"! queue max-size-buffers=8 leaky=downstream "
|
||||||
"! flvmux name=live_mux streamable=true "
|
"! flvmux name=live_mux streamable=true "
|
||||||
"! rtmpsink name=live_sink location=\"" +
|
"! rtmpsink name=live_sink location=\"" +
|
||||||
live_rtmp + "\" sync=false async=false drop-on-latency=true ";
|
live_rtmp + "\" sync=false async=false ";
|
||||||
|
|
||||||
GError* err = nullptr;
|
GError* err = nullptr;
|
||||||
GstElement* pipeline = gst_parse_launch(pipeline_str.c_str(), &err);
|
GstElement* pipeline = gst_parse_launch(pipeline_str.c_str(), &err);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user