Ask Your Question

Help with using multiple USB cameras

asked 2013-04-10 11:30:00 -0500

rustyhowell gravatar image

I'm trying to create two Camera() objects in the simplecv shell. I have two USB cameras attached, and I'm using Ubuntu 12.04 x86. Both cameras appear as /dev/video{0,1}. I can use each camera by itself, but I cannot instantiate two USB cameras at the same time.

Also in the shell, I cannot reinitialize a camera. I have to quit the shell and restart it.

cam0 = Camera(0)
cam1 = Camera(1)  # This will fail


cam1 = Camera(1)
cam0 = Camera(0)  # Now this device will fail

Any suggestions?

edit retag flag offensive close merge delete



could you show what errors are you facing? I just tried it with index 1 and 2 and it's working fine.

jayrambhia gravatar imagejayrambhia ( 2013-04-10 14:46:00 -0500 )edit

What errors are you getting? Are your other USB ports busy? Cooling pad, mouse, etc?

jayrambhia gravatar imagejayrambhia ( 2013-04-16 15:42:12 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2013-04-11 10:41:51 -0500

sushilthe gravatar image

First, you can check the location of your cameras.


ls /dev/video0

in the terminal it should return /dev/video0 if it exists and do the same for other device. The 0 and 1 parts are the one you should supply to the SimpleCV camera code.


Second, without much effort you can use the code from Pycam List and check the camera and its location. This method will also provide the codes you can use in other python programs for listing cameras. The location part is the one you should be using in the SimpleCV code.

edit flag offensive delete link more

answered 2013-04-16 12:26:13 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I have tried doing the same in both Windows 7(SimpleCV) and Ubuntu 12.04(OpenCV). It seems to work fine in both OS for me, so the problem might not be in SimpleCV itself. It might be the way 'your' machine's resources are being arranged by the kernel. Can you check to see if it works in other machines?

edit flag offensive delete link more


I made a tutorial using two USB cameras. Hope it helps.

aayushjr gravatar imageaayushjr ( 2013-04-21 23:31:48 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-04-10 11:30:00 -0500

Seen: 1,106 times

Last updated: Apr 16 '13