This commit is contained in:
cxh 2025-12-29 14:03:36 +08:00
parent b24a26e603
commit dbf9e51c4d

View File

@ -77,12 +77,8 @@ 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 cmd = "v4l2-ctl -d " + cam.device + " --set-fmt-video=width=" + std::to_string(width) +
",height=" + std::to_string(height) + ",pixelformat=NV12";
system(cmd.c_str());
std::string pipeline_str = "v4l2src name=src device=" + cam.device + std::string pipeline_str = "v4l2src name=src device=" + cam.device +
" io-mode=dmabuf " " io-mode=dmabuf do-timestamp=true "
" ! 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) +