You can open with three api CAP_GPHOTO2 CAP_V4L or CAP_GSTREAMER
try
cv::VideoCapture cap(0, cv::CAP_V4L);
If it does not work try another api
You can open with three api CAP_GPHOTO2 CAP_V4L or CAP_GSTREAMER
try
cv::VideoCapture cap(0, cv::CAP_V4L);
If it does not work try another api