I am using a library (librealsense) that only outputs the bus and port number as such (9.1). It uses libusb internally. The issue is from this identifier in libusb I want to know what physical device it belongs to in /dev/video0. For instance, 9.1 -> /dev/video0 and 7.2 -> /dev/video2 when two cameras are plugged in in ports 9.1 and 7.2.
Is this possible? How do I acquire what devices paths belong to a bus and port? Any partial answer would be helpful.
udev, you could useudevadm info -n video0 -q allto see the created symlinks; e.g.S: v4l/by-path/pci-0000:00:13.2-usb-0:4.1:1.0-video-index0shows the link in/dev/v4l/by-path. Or, if you know the ID of your cameras,/dev/v4l/by-idcould help. And configuringudevmight give fixed devices for different cameras.video*device) by examining/sys/class/video4linux/, which contains symlinks with the complete bus path (usb or otherwise).ls -l /sys/class/video4linux/, you should see all video devices as symlinks.udevadmalso just looks at the/sysfile system, but extracts more information from it (most of which you don't need for your question).