I bought a new usb webcamera,plug it .
ls -l /dev/video*
crw-rw----+ 1 root video 81, 0 Nov 21 10:57 /dev/video0
crw-rw----+ 1 root video 81, 1 Nov 21 10:57 /dev/video1
Why only one usb camera shows two Video4Linux devices?
Very shortly
Your application should use /dev/video0
, for usual stuff, as /dev/video1
gives you meta-data image, to be used by algorithms, to improve image quality.
A bit more deeply
Look at the Device caps
section, as they are different for both devices:
$ v4l2-ctl -D -d /dev/video0
...
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
$ v4l2-ctl -D -d /dev/video1
...
Device Caps : 0x04A00000
Streaming
Extended Pix Format
The device caps is documented as follows:
* @device_caps: capabilities accessed via this particular device (node)
The bits, that are different for these are:
#define V4L2_CAP_VIDEO_CAPTURE 0x00000001 # bit 1
#define V4L2_CAP_META_CAPTURE 0x00800000 # bit 23
The applications need to check this in order to know what kind of buffer it will receive, as this should be used by the streaming ioctls: VIDIOC_REQBUFS, VIDIOC_QBUF, VIDIOC_DQBUF
Read more about this discussion from https://bugzilla.kernel.org/show_bug.cgi?id=199575