I can’t connect 2 PS3 Eye cameras. There are 2 ports via
from pygrabber.dshow_graph import FilterGraph
def get_available_cameras() :
devices = FilterGraph().get_input_devices()
available_cameras = {}
for device_index, device_name in enumerate(devices):
available_cameras[device_index] = device_name
return available_cameras
print(get_available_cameras())
{0: 'PS3 Eye Universal', 1: 'OBS Virtual Camera'}
There are 2 cameras in the device manager
they have a different instance path. USB\VID_1415&PID_2000&MI_00\6&1BB8019&1&0000 USB\VID_1415&PID_2000&MI_00\6&D1B3DBD&1&0000
I have already tried changing the port and connecting it to another bus.
No. this is for the camera list. There are also 2 cameras through for. I can only use 1 camera when I need 2 (2 cameras are connected but no id) they work separately, but not together.
as far as I know, OpenCV’s VideoCapture with DSHOW backend only takes plain indices that change with device enumeration, but not device paths of any kind. that is one of its longstanding weaknesses.
if both cameras are attached, then I expect that both are actually addressable through VideoCapture, by index.
I am not familiar with pygrabber and its abilities. you showed that it only enumerates one of your devices, right? then that seems to be an issue with pygrabber. it appears to be abandoned. no commit in 6 years.
def find_working_camera():
index = 0
working_cameras = []
while index <99:
cap = cv2.VideoCapture(index)
if cap.isOpened():
working_cameras.append(index)
cap.release()
else:
break
index += 1
return working_cameras