I have 4 Unibrain Fire-I cameras daisy-chained to my computer (Ubuntu 12.10), and an app written with OpenCV that right now reads frames from 2 of these cameras. However, I'm discovering that every time I plug/unplug the firewire connector to my computer the addresses change. What identifies in cv::VideoCapture as "0" in one run, changes to number 3 in the next.
Is there some better way to identify cameras that is more reliable that by using the number?
I had a similar problem with the indexes of VideoCapture. I got 4 USB Webcams and I need to know which webcam corresponds to which index. OpenCV does not seam to support any identification of the cameras. I'm using Mac OS 10.8 so I cant offer you a fix for Ubuntu but maybe my solution can give you hint where to look. I looked up in the OpenCV sources where opencv is retrieving the camera information and found the Mac OS-framework-(AVFoundation). Using this framework i managed to get the order of the webcams and their hardware ids. This order corresponds with camera indexes for the VideoCapture class making index change e.g. after reboot no longer a problem.
Edit: my solution for MacOS: Since I'm working with java and I didn't want to build a wrapper with jna or jni, i created a simple objective-c commandline-tool which prints the id's of the cameras on console. Afterwards i execute the commandline tool via Runtime.getRuntime().exec() in java.
Objective-c commandline tool main.m
to compile
snippt for java
An alternative solution for linux might be to use a udev rule to fix the camera order on the OS-side. But I didn't experimented with that since Mac OS is lacking udev.