Using gstreamer command scripts can open the camera, but it can't open the camera, the use of Opencv use v4l2 CTL - list - devices, display/dev/video0,
My libv4l2 version is 1.18 (used apt - get the install method, installation is 1.8.3, also is not), however, my gstreamer libraries are using the default apt - get installed 1.8.3 version,
O master!!!!!!
The code is as follows:
Int main (int arg c, char * * argv)
{
VideoCapture cap (0);
//VideoCapture cap (" nvcamerasrc! Video/x - raw (memory: which), width=1280 (int), height=(int), 720, the format=(string) I420, framerate=24/1 (fraction)! Nvvidconv flip - method=2! Video/x - raw, format=(string) BGRx! Videoconvert! Video/x - raw, format=(string) BGR! Appsink ");
if (! Cap. IsOpened ())
{
Cout & lt; <"Failed to open camera." & lt;
}
For (;; )
{
Mat frame;
Cap & gt; & gt; Frame;
Imshow (" what ", frame);
If (waitKey (30) & gt;=0)
break;
}
return 0;
}