I have a project running Python with OpenCV and Pygame under Ubuntu 14.04 that uses two USB cameras, images from which are processed and displayed on the local monitor.
If the system is started with both cameras connected everything runs fine, if I disconnect one camera the associated part of the display freezes as expected. The disconnection is detected and the associated video capture object released. When the camera is reconnected the reconnection is detected and a new video capture object created and the display eventually resumes updating but ONLY if the camera has been allocated the same index, e.g. /dev/video0, as it had before it was disconnected.
I would like to know where I could look to try and find out why the video capture does not start if the device index is different on reconnection. I am new to Ubuntu, Python etc but have many years experience in microcontrollers and Visual Basic.
Thanks