connecting many (!) webcams with OF

I have an idea in mind which would make use of ALOT of webcams (at least 20) and I was wondering if I could use them all at one mac if I would simply use alot of USB hubs? I know, using them all at the same time would not work, but since I actually only need an image from one (3 at max, dont know yet) at a time, I was wondering if it would work to switch them on and OF to keep performance in realtime.
In theory that should work, but since they would have to switch fast, I was wondering if there is some kind of laag or startuptime till a camera actually grabs an image. The cameras I have in mind are the ps3 eyes.
Also, I remember there was an error keeping the IDs of the cameras the same on the mac, does anybody know if thats fixed? Is there a maximum of device IDs I can use in OF?
Lots of questions for a simple idea :slight_smile:

Thank you!

Hi Moka,

Sounds like a fun project! I’ve done a problem where we had to use 5 webcams (see the webcams on the helmets over here: http://www.roljerot.nl ). We had lot’s of problems with using more than 3 webcams.

On my development computer I got 4 webcams working really well, but when we moved our code to the production-computer for the project we had all kinds of troubles:

  • power fluctuations which caused the PC to crash completely
  • data overload as USB has a limit on the DATA throughput (the strange thing was, that this happened only sometimes)

And indeed the IDs change which sucks; I think this is a problem of the USB standard but I’m not sure.

I’m also not really sure if you switching would work as the webcam/USB connection needs to be initialized before the webcam can work.

I remember seeing a project where they used more than 5 but I cannot find them anymore, sorry. You could go for a distributed approach where you hook up a couple of webcams per computer and stream the video to your application.

Good luck!

Roxlu

we had tons of troubles working with more than 2 usb-cams. 20 cams will never work. not even with hubs or anything. you’ll have to find a different technology to work with more than 2 or 3 cams.

best
joerg

you may have good luck with an analog video switching unit, some of which can be controlled by serial data for example or otherwise, and small security cameras. check out security shops like supercircuits, for example, to see what kind of options are out there. one plus is that analog video (BNC coax, for example) can run over very long distances and the cameras can be quite cheap.

  • z

okay thanks, i actually guessed it would not be that simple :slight_smile:

i definitely agree with Zach that analog could be a lot simpler (and cheaper), especially if you only ever need to capture from at most 3 cameras at once. I’ve used 6 firewire cameras at the same time on a mac pro, and needed to use a separate firewire PCI card as well as the onboard firewire (3 cameras daisy chained on pci fw port, 3 cameras daisy chained on motherboard fw port). At the time there was the problems with the deviceids getting mixed up, but that’s fixed I think (haven’t tried).

Problem you start running into with lots of USB or fw devices are IRQ and/or DMA (Can’t remember exactly which one was the problem when I was trying to use 6 cameras). So external buses don’t help, but adding extra PCI controller cards can help (it did in my case). So theoretically you could just add 4 PCI USB controller cards, 4 cameras on each, and another 4 on the motherboard for 20 usb cameras (i haven’t tried this). But still I’d say the analog approach would be way simpler, especially to wire up. You can also get multiplexers that take 4 or 9 inputs, tile them, and output a single output. If you don’t need hi-res, with just two 3x3 multiplexers and two usb capture cards you can do roughly what you want (18 cameras). Is this for a home grown timeslice rig by any chance? :wink:

we haven’t been successful with even using a separate usb-pci card in a mac pro. it didn’t improve the situation that much.
for the next project i’d also try the analog solution.

best
joerg