From c46fe93dbb17aea3b81ee6015f2740c20b7908eb Mon Sep 17 00:00:00 2001 From: jario Date: Fri, 27 Oct 2023 13:39:03 +0800 Subject: [PATCH] fix MIPI 4K reading --- video_io/sv_video_input.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/video_io/sv_video_input.cpp b/video_io/sv_video_input.cpp index 60f0319..5ca7bfa 100644 --- a/video_io/sv_video_input.cpp +++ b/video_io/sv_video_input.cpp @@ -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); } }