Videoio Error: V4l: Can't Find Camera Device
I am using ubuntu16.04 and trying to run opencv script. when i use: video_capture = cv2.VideoCapture(-1) it gives me error VIDEOIO ERROR: V4L: can't find camera device No video wi
Solution 1:
The suggestion api55 gave in his comment
video_capture = cv2.VideoCapture(0)
is what I would try first.
Generally, you can list the available cameras with ls /dev/video*
or v4l2-ctl --list-devices
. Here sample output:
NZXT-U:rt-trx> v4l2-ctl --list-devices
Microsoft® LifeCamCinema(TM): (usb-0000:00:14.0-1):
/dev/video1
Microsoft® LifeCamCinema(TM): (usb-0000:00:1a.0-1.3):
/dev/video0
/dev/video0
corresponds to device id 0, etc.
PS: v4l2-ctl
is quite useful for solving camera issues and can do much more than --list-devices
. I installed it via packagev4l-utils
on a 16.04 machine.
Solution 2:
Late, but to get mine working i put in terminal:
-ltrh /dev/video*
To get a list of the video devices that are plugged into my computer. Then for each one I did:
sudo chmod 777 /dev/videox
Where x was one of the video files that were listed, giving everything access to them. Probaly not the most secure solution, but it got my code working.
Post a Comment for "Videoio Error: V4l: Can't Find Camera Device"