Multiple webcams (4) - How to get same ID == same webcam

Hi there!

I’ve created an application that reads 4 webcam streams. Though
everytime I restart my computer the ID’s and webcams changes.
So the first time the setup is like:

  • webcam 0: id 0
  • webcam 1: id 1
  • webcam 3: id 2
  • webcam 4: id 3

But the second time:

  • webcam 0: id 0
  • webcam 1: id 3
  • webcam 3: id 2
  • webcam 4: id 1

Does someone know how I can make sure the same webcam gets the same ID everytime I start my (winxp) computer?


I had the same problem on mac and was a complete nightmare, could not find a solution for it. I think Theo has rewritten some stuff for the upcoming 006 release which addresses this issue, but I’m not sure if its mac only or not…

I “partially solved” with a stupid xml setting… addressing manually the “output camera”

so id:1 —>position 1
after reboot
id:2 —>position 1

At the reboot usually if not changing the usb connection the id (in xp pro sp2) remain the same, but if u use different webcam… (for example 3 of 1 kind and one of another) it is more random… one tend to assume (in my case) allways the same id, the other totally mess to every restart.

My task was just sending out information about each single cam, so i just changed the identifier when writing on the socket, using the one i reassigned on the startup of the app…

It maybe boring to rewrite manually the xml every reboot… but it is just 1 minutes to fill 4 numbers (not a big deal), I sow that the id never change restarting the app.

in my mac… just change on disconnectiong usb (but only using laptop port), once it reboots with all plugged the id never change.

Hi All,

Sorry for bumping an old post. I cannot figure out a good solution for this case. I am using OF0.0.8 / Win7 / 4x Logitech C920 webcam.

I grabbed the iSerialNumbers of cameras with libusb but couldn’t find a way associate them with ofVideoGrabber/VideoInput class. Is there any way to get the unique identifier or serial number from the original OF class?

I also get those troubles,
It seems that it came from osx. you could avoid it using differents usb hubs, one camera on one hub…

Thanks Dudley. Does it apply to Windows too?
I tested switching on/off the PC a several times and it is true, but I am not sure…too few test samples comparing with a permanent run (daily operation, restart everyday)