fix MIPI 4K reading

This commit is contained in:
jario 2023-10-27 13:39:03 +08:00
parent a8a4cac3ad
commit c46fe93dbb
1 changed files with 1 additions and 2 deletions

View File

@ -79,7 +79,6 @@ void Camera::openImpl()
else if (this->_type == CameraType::MIPI)
{
char pipe[512];
this->_cap.open(this->_camera_id);
if (this->_width <= 0 || this->_height <= 0)
{
this->_width = 1280;
@ -90,7 +89,7 @@ void Camera::openImpl()
this->_fps = 30;
}
sprintf(pipe, "nvarguscamerasrc framerate=(fraction)%d/1 ! nvvidconv flip-method=0 ! video/x-raw, width=(int)%d, height=(int)%d, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink",this->_fps,this->_width,this->_height);
sprintf(pipe, "nvarguscamerasrc sensor-id=%d ! video/x-raw(memory:NVMM), width=(int)%d, height=(int)%d, format=(string)NV12, framerate=(fraction)%d/1 ! nvvidconv flip-method=0 ! video/x-raw, width=(int)%d, height=(int)%d, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink", this->_camera_id, this->_width, this->_height, this->_fps, this->_width, this->_height);
this->_cap.open(pipe, cv::CAP_GSTREAMER);
}
}