I am working with an embedded Linux device (Raspberry Pi, Debian) with two identical USB cameras connected. The two cameras are attached on different physical location: one on front of our machine, one on top of it. So it is important to distinguish them.

However, what I can see in system is only /dev/video0 and /dev/video1. Suppose I always connect the two cameras on fixed USB ports, how can I know which device file corresponds to which USB device?

I have tried lsusb, but it don't give information about the device files.

  • 1
    If you always have the same camera at the same USB (as supposed), and you are using video4linux video system, there are some links in /dev/v4l/by-path pointing to the respective video device (try ls -l /dev/v4l/by-path). The link name is the system path and contains information on the USB port. An other possibility, if e.g. the serial numbers of the cameras are different, is to use the udev system, but that would need a longer answer. – ridgy Jun 27 '17 at 21:01
  • @ridgy It works well. Thanks for a lot! And if possible, please post it as an answer. – jiandingzhe Jul 4 '17 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.