1
This commit is contained in:
parent
dbf9e51c4d
commit
ee0f84304b
@ -77,23 +77,31 @@ GstElement* RTMPManager::create_pipeline(const Camera& cam)
|
|||||||
const std::string live_rtmp = "rtmp://36.153.162.171:19435/" + app + "/" + stream_name + "?vhost=live";
|
const std::string live_rtmp = "rtmp://36.153.162.171:19435/" + app + "/" + stream_name + "?vhost=live";
|
||||||
const std::string record_rtmp = "rtmp://127.0.0.1:2935/" + app + "/" + stream_name + "?vhost=record";
|
const std::string record_rtmp = "rtmp://127.0.0.1:2935/" + app + "/" + stream_name + "?vhost=record";
|
||||||
|
|
||||||
std::string pipeline_str = "v4l2src name=src device=" + cam.device +
|
std::string pipeline_str = "v4l2src device=" + cam.device +
|
||||||
" io-mode=dmabuf do-timestamp=true "
|
" io-mode=dmabuf "
|
||||||
" ! video/x-raw,format=NV12,"
|
"! video/x-raw,format=NV12,"
|
||||||
"width=" +
|
"width=" +
|
||||||
std::to_string(width) + ",height=" + std::to_string(height) +
|
std::to_string(width) + ",height=" + std::to_string(height) +
|
||||||
",framerate=" + std::to_string(fps) +
|
",framerate=" + std::to_string(fps) +
|
||||||
"/1 "
|
"/1 "
|
||||||
" ! mpph264enc "
|
"! queue max-size-buffers=4 leaky=downstream "
|
||||||
"profile=high "
|
"! mpph264enc "
|
||||||
|
"profile=baseline " // ⭐ 关键:别用 high
|
||||||
|
"bframes=0 " // ⭐ 关键:禁 B 帧
|
||||||
|
"gop=" +
|
||||||
|
std::to_string(fps) +
|
||||||
|
" "
|
||||||
|
"rc-mode=cbr "
|
||||||
"bps=" +
|
"bps=" +
|
||||||
std::to_string(bitrate) + " gop=" + std::to_string(fps) +
|
std::to_string(bitrate) +
|
||||||
" rc-mode=cbr "
|
" "
|
||||||
" header-mode=each-idr "
|
"header-mode=each-idr "
|
||||||
" ! h264parse config-interval=1 "
|
"! h264parse "
|
||||||
" ! queue max-size-buffers=5 max-size-time=0 leaky=downstream "
|
"config-interval=1 "
|
||||||
" ! flvmux streamable=true "
|
"disable-passthrough=true "
|
||||||
" ! rtmpsink location=\"" +
|
"! queue max-size-buffers=5 leaky=downstream "
|
||||||
|
"! flvmux streamable=true "
|
||||||
|
"! rtmpsink location=\"" +
|
||||||
live_rtmp + "\" sync=false async=false";
|
live_rtmp + "\" sync=false async=false";
|
||||||
|
|
||||||
GError* error = nullptr;
|
GError* error = nullptr;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user