Four /dev/video entries but just one camera
Solution 1
The answer given here https://unix.stackexchange.com/questions/512759/multiple-dev-video-for-one-physical-device is a good one. I have the same problem with Skype and it started when I upgraded the kernel from 4.4.x to 5.1.x so somewhere in there the uvcvideo module produced a different output. However, has it is pointed out the output of
v4l2-ctl --device=/dev/video* --all
does show that each entry has a different capability, and in the case of my logitech usb camera only 1 has video capture. So this is most likely a bug in Skype, that appeared after the kernel probably fix a bug themselves, that does not only shows the entries that have a "Video capture" capability.
Solution 2
Each camera has a second metadata device added to output timestamp information or detailed per frame metadata
You can use v4l2-ctl
to get more information on a device, and can use v4l2-ctl --list-formats --device /dev/videoX
to determine if it contains video streams.
To list just devices with video data use:
for dev in `find /dev -iname 'video*' -printf "%f\n"`
do
v4l2-ctl --list-formats --device /dev/$dev | \
grep -qE '\[[0-9]\]' && \
echo $dev `cat /sys/class/video4linux/$dev/name`
done
This can be combined with fzf
to select a camera and launch a program:
for dev in `find /dev -iname 'video*' -printf "%f\n"`;do; v4l2-ctl --list-formats --device /dev/$dev | grep -qE '\[[0-9]\]' && echo $dev `cat /sys/class/video4linux/$dev/name`;done | fzf | awk '{ printf("/dev/%s", $1) }' | xargs guvcview --device
Solution 3
The difference between /dev/video0 and /dev/video1 for a single camera is that one is for 'Video Capture' and the other is for 'Metadata Capture'.
It can be checked in 'Device Caps' info below:
The following command shows the info for /dev/video0:
$ v4l2-ctl --info --device /dev/video0
Driver Info (not using libv4l2):
Driver name : uvcvideo
Card type : 720p HD Camera: 720p HD Camera
Bus info : usb-0000:00:14.0-6
Driver version: 5.3.18
Capabilities : 0x84A00001
Video Capture
Metadata Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
And for /dev/video1:
$ v4l2-ctl --info --device /dev/video1
Driver Info (not using libv4l2):
Driver name : uvcvideo
Card type : 720p HD Camera: 720p HD Camera
Bus info : usb-0000:00:14.0-6
Driver version: 5.3.18
Capabilities : 0x84A00001
Video Capture
Metadata Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04A00000
Metadata Capture
Streaming
Extended Pix Format
Solution 4
To find out what each device is, you can run this (and change the number in video0 to video1, etc):
cat /sys/class/video4linux/video0/name
Googling Dell XPS 9370 gives information that this model has also an infrared camera in addition to the normal web camera, and the infrared camera can be used for authenticating with face recognition. https://wiki.archlinux.org/index.php/Dell_XPS_13_(9370)
If you want to disable for example the IR camera, more information about your system is needed, for example dmesg.
Related videos on Youtube
![InvisibleShadowGhost](https://lh3.googleusercontent.com/-XdUIqdMkCWA/AAAAAAAAAAI/AAAAAAAAAAA/4252rscbv5M/photo.jpg?sz=256)
InvisibleShadowGhost
Updated on September 18, 2022Comments
-
InvisibleShadowGhost almost 2 years
I have a Dell XPS 9370, which is known to have only one camera. But
ls /dev/video*
results in/dev/video0 /dev/video1 /dev/video2 /dev/video3
, so four different camera devices.
These four cameras bubble up to the applications, e.g. Skype which lists four cameras, but just the first one (/dev/video0
) works.Does anybody know where the other entries come from? Or how to hide them from higher layers?
-
André about 5 yearsI second the problem for a "Logitech, Inc. Portable Webcam C905" USB camera. I get
/dev/video0
and/dev/video1
. For me, the problem occurs after upgrading from Ubuntu 14.04 to Kubuntu 18.04.lsusb
only shows one device, whereas udevadm shows two identical devices. Which OS are you using? -
InvisibleShadowGhost about 5 yearsInteresting. It happens for me in Ubuntu 18.10, 19.04 and 19.10, as well as in Arch and Manjaro...
-
-
InvisibleShadowGhost over 5 yearsAll of the cameras (
dev0
,dev1
,dev2
anddev3
) return the same thing:Integrated_Webcam_HD: Integrate
. Which part of thedmesg
do you need? -
InvisibleShadowGhost about 5 yearsThanks for the pointer, I also get different capabilities for each of them. Your guess, that it's a Skype bug seems correct, as e.g. gnomes cheese only shows one camera.
-
TehTris almost 5 yearsThis is not a skype bug. I don't have skype installed and am experiencing this right now on 18.04. Vlc shows 2 cameras, and only one of them work.
v4l2-ctl --list-devices
shows 2 cameras, (lowest number seems to be the one that works most of the time).udevadm info -a -n /dev/videoX
on the one that works shows a BUNCH of info about the camera, and on the one that doesnt work, almost nothing. My guess is that this is more of a v4l2 version 1.10.0 version VS v4l2 version 1.14.2. This also happened to me when going from 16.04 to 18.04 -
matanster over 2 yearsThe list following
Capabilities:
is the same for all devices that belong to the same physical camera, but only those followingDevice Caps:
defer. I guess that is like that by convention.