I am trying to get a little camera preview window running with some OpenCV code.
I naively tried the example here first: http://docs.opencv.org/3.0-beta/modules/videoio/doc/reading_and_writing_video.html
and the result was a failure of opening the capture with another error: HIGHGUI ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
After some reading, it turned out that you have to write
VideoCapture cap("nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)640, height=(int)480, format=(string)I420, framerate=(fraction)30/1 ! nvvidconv flip-method=2 ! video/x-raw, format=(string)I420 ! videoconvert ! video/x-raw, format=(string)BGR ! appsink");
However, this still does not succeed! There is no more HIGHGUI error, but the capture is not working.
Am I missing something? I tried compiling with g++ and cmake, both have the same result.