I have been trying to use 3 cameras with Python and OpenCV and I can do it. The problem is that the VideoCapture parameter changes, I've had the idea that it depends on the order of connecting the cameras, being 0 the webcam and external cams starting from 1, but sometimes the webcam turns on with a value different than 0, it gets a bit frustrating after a while and I can't seem to find a solution.
This is the code I have been using to start webcams, the weird thing is that most of the times it pops up the webcam when I dont put a 0, and the external camera opens with the 0.
# Starting Camera 1
self.cap = cv2.VideoCapture(1, cv2.CAP_DSHOW)
self.cap.set(self.FRAME_PROP_WIDTH, self.frame_w)
self.cap.set(self.FRAME_PROP_HEIGHT, self.frame_h)
self.cap.set(cv2.CAP_PROP_FPS,30)
# Starting Camera 2
self.cap = cv2.VideoCapture(2, cv2.CAP_DSHOW)
self.cap.set(self.FRAME_PROP_WIDTH, self.frame_w)
self.cap.set(self.FRAME_PROP_HEIGHT, self.frame_h)
self.cap.set(cv2.CAP_PROP_FPS,30)
# Starting Camera 3
self.cap = cv2.VideoCapture(3, cv2.CAP_DSHOW)
self.cap.set(self.FRAME_PROP_WIDTH, self.frame_w)
self.cap.set(self.FRAME_PROP_HEIGHT, self.frame_h)
self.cap.set(cv2.CAP_PROP_FPS,30)