2

consider a schenario where i am connecting 2 cameras to 2 usb ports the camera i connect first will always come in stream 0 for code below where as i want the stream 0 to always read from a specific usb port.

import cv2
vc1 = cv2.VideoCapture(0)
vc2 = cv2.VideoCapture(2)
vc3 = cv2.VideoCapture(4)

I want to hard code each camera to a specific usb port in python so no matter in what order the cameras are connected the camera from usb port 1 should always come in a specific stream and same for all streams.

Jayant Rajwani
  • 727
  • 9
  • 16
  • Does this answer your question? [Find USB serial port with Python script](https://stackoverflow.com/questions/57745554/find-usb-serial-port-with-python-script) – stovfl Feb 25 '20 at 13:58
  • no it doesn't finding usb serial is easier i can even use dmesg --follow consider a schenario where i am connecting 2 cameras to 2 usb ports the camera i connect first will always come in stream 0 for above code where as i want the stream 0 to always read from a specific usb port. – Jayant Rajwani Feb 25 '20 at 14:01
  • ***" i want the stream 0 to always read from a specific usb port."***: Then you are off, it's not the ability of a user to decide which port number a specific hardware is bound to. You have to define this at OS level, ask at [unix.stackexchange.com/](https://unix.stackexchange.com/) – stovfl Feb 25 '20 at 14:06

0 Answers0