2

I have two webcams connected to my machine, running Linux Mint.

jacoby@oz:~$ ls /dev/video*
/dev/video0  /dev/video1
jacoby@oz:~$ lsusb
...
Bus 001 Device 003: ID 046d:08ce Logitech, Inc. QuickCam Pro 5000
Bus 002 Device 002: ID 046d:092e Logitech, Inc. QuickCam Chat
...
jacoby@oz:~$ 

I have code that grabs the lowest numbered /dev/video* and uses streamer to take a picture. What I want is to be able to know I'm going for the better or worse of the two cameras (neither are new cams, but they work for my needs), but I know no way to determine which lsusb entry points to which device.

It's an obvious enough problem that I'm sure it's solved, but my vague googling has not pointed to the right answer.

3
  • Examine the output of dmesg; usually the driver prints a message which device is attached to /dev/... (generally speaking; I never used a webcam with linux).
    – mpy
    Aug 14, 2013 at 14:00
  • Looking through dmesg, I'm seeing my Logitech Unifying kit all over the place, but not seeing the webcams. Aug 14, 2013 at 14:16
  • is this to be done manually or for the purpose of any sort of coding ?
    – Ashildr
    Aug 14, 2013 at 15:37

1 Answer 1

0

I'm using v4l, and since I know the preferred camera has 'UVC Camera' in /sys/class/video4linux/video*/name, I use the one that has that string in that file.

There might be a better answer, but this is good enough for now.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.