does oF support multiple usb webcams in the same program?

I’m coming to oF from Processing, after spending a lot of time trying to get multiple webcams to work in the same sketch. I don’t need anything that fancy, but I want to be able to access images from multiple cameras (ideally 4 or more) and show the images from one of them at a time (e.g. cam1 for a few frames, then cam2 for a few more, etc.).

Is this possible in oF?

I tried out the movieGrabberExample project. Worked great for one camera. And I was happy to see that the listDevices() function is correctly identifying all of my cameras (something Processing doesn’t do).

So then I created a second ofVideoGrabber variable and copied the code for the initial one so that I was setting up a second camera, but each one with a different deviceID. I get video from the first, but white from the second, and this error in the console:

OF_WARNING: No camera settings to load
OF_ERROR: ***** ofVideoGrabber error *****
OF_ERROR: -------------------------------------

Am I doing something wrong? But most importantly, is it possible to do what I want in oF?

I’m on a mac.

thanks!

I have done it on 4 PS Eye Cam with Macam driver, on Mac :slight_smile:

Windows solution: http://codelaboratories.com/forums/viewthread/376/#1291

has anyone made it work with multiple non PS3eye cams on the mac? I’ve got a pile of UVC webcams to use.

I’ve used multiple non-PS3 cameras but I typically will run out of USB bandwidth on a MacPro around 3 cameras (depends on cameras/resolution).

was there any trick to making it work? i’m just creating multiple ofVideoGrabber objects and trying to tie them to different cameras using the appropriate deviceID, but it’s throwing an error after the first one gets set up.

I didn’t do anything special driver/hardware wise

ok, i’ve got it working for multiple cameras (I had inadvertently left out some code for additional cams), but only for those that are by themselves on a USB connector. but when i put a couple cameras on a hub, it only grabs frame from one instead of both (shows white for the second one). it’s not the specific camera…if i switch deviceIDs I get the other one. it’s just that it will only show one.

this, despite the fact that listDevices() sees them all.

is it possible to have more cameras than one has usb connectors? i’m on a MBP and only have two (although i can get up to 3 cameras if i use the built-in iSight as one of them).

[quote author=“mixwhit”]ok, i’ve got it working for multiple cameras (I had inadvertently left out some code for additional cams), but only for those that are by themselves on a USB connector. but when i put a couple cameras on a hub, it only grabs frame from one instead of both (shows white for the second one). it’s not the specific camera…if i switch deviceIDs I get the other one. it’s just that it will only show one.

this, despite the fact that listDevices() sees them all.

is it possible to have more cameras than one has usb connectors? i’m on a MBP and only have two (although i can get up to 3 cameras if i use the built-in iSight as one of them).[/quote]

I think the problem is USB Bandwidth :slight_smile:

it depends on the usb chipset, which can’t handle more than one ps3eye. but you maybe can have luck with other cams with lower resolution/framerate.

I used 3 webcams and 3 usb tv cards on one desktop pc and it was hard to find a connection setup where all devices work properly. it depends also on the driver, if it can handle more than one device of the same type, especially on windows I got some problems with this.