ubuntu 16.04, "VIDEOIO(V4L2:/dev/video0): can't open camera by index" after software update

asked 2019-12-17 20:33:22 -0600

ChanKim gravatar image

I have opencv 3.4 installed in my ubuntu 16.04 machine. It worked fine until yesterday evening. I did a software update (ubuntu S/W udpate), they system told me I need to reboot the computer, but I didn't. opencv workd ok with cameras before I reboot. But after I rebooted the computer this morning. opencv can't get usb camera. The error message is below. (I used two USB cameras)

...
Loading weights from yolov3.weights...Done!
[ WARN:0] OpenCV | GStreamer warning: GStreamer: pipeline have not been created
[ WARN:0] VIDEOIO(V4L2:/dev/video0): can't open camera by index
[ WARN:0] OpenCV | GStreamer warning: GStreamer: pipeline have not been created
[ WARN:0] VIDEOIO(V4L2:/dev/video1): can't open camera by index
Couldn't connect to webcam.
: Resource temporarily unavailable
darknet: ./src/utils.c:256: error: Assertion `0' failed.

What is the problem? (I'm using C program)

edit retag flag offensive close merge delete

Comments

How could anyone know what was updated and what went wrong in Ubuntu, not likely in OpenCV. Things to do: unplug camera anf plug it in again. Test if any other program can access camera. Seek help in some Ubuntu forum.

mvuori gravatar imagemvuori ( 2019-12-18 05:36:16 -0600 )edit