It is said on the Internet that the following command can be used to print the computer's camera:
ls /dev/video*
But what I printed out is a bunch of videos. In fact, there is only a built-in camera and an external usb camera on my computer.
liuhuan@liuhuan-G5-5587:~$ ls /dev/video*
/dev/video0 /dev/video1 /dev/video2 /dev/video3
So how do we know which one of the cameras printed above is the real camera? Then use the v4l2-ctl
command:
sudo apt install v4l-utils
Below we perform the experiments one by one with the following instructions:
v4l2-ctl -d /dev/video0 --all
video0
liuhuan@liuhuan-G5-5587:~$ v4l2-ctl -d /dev/video0 --all
Driver Info:
Driver name : uvcvideo
Card type : Integrated_Webcam_HD: Integrate
Bus info : usb-0000:00:14.0-5
Driver version : 5.8.18
Capabilities : 0x84a00001
Video Capture
Metadata Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
Width/Height : 640/480
Pixel Format : 'YUYV' (YUYV 4:2:2)
Field : None
Bytes per Line : 1280
Size Image : 614400
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Limited Range)
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 640, Height 480
Default : Left 0, Top 0, Width 640, Height 480
Pixel Aspect: 1/1
Selection Video Capture: crop_default, Left 0, Top 0, Width 640, Height 480, Flags:
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 640, Height 480, Flags:
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 30.000 (30/1)
Read buffers : 0
brightness 0x00980900 (int) : min=-64 max=64 step=1 default=0 value=0
contrast 0x00980901 (int) : min=0 max=95 step=1 default=0 value=0
saturation 0x00980902 (int) : min=0 max=100 step=1 default=64 value=64
hue 0x00980903 (int) : min=-2000 max=2000 step=1 default=0 value=0
white_balance_temperature_auto 0x0098090c (bool) : default=1 value=1
gamma 0x00980910 (int) : min=100 max=300 step=1 default=100 value=100
gain 0x00980913 (int) : min=1 max=8 step=1 default=1 value=1
power_line_frequency 0x00980918 (menu) : min=0 max=2 default=2 value=2
0: Disabled
1: 50 Hz
2: 60 Hz
white_balance_temperature 0x0098091a (int) : min=2800 max=6500 step=1 default=4600 value=4600 flags=inactive
sharpness 0x0098091b (int) : min=1 max=7 step=1 default=2 value=2
backlight_compensation 0x0098091c (int) : min=0 max=3 step=1 default=3 value=3
exposure_auto 0x009a0901 (menu) : min=0 max=3 default=3 value=3
1: Manual Mode
3: Aperture Priority Mode
exposure_absolute 0x009a0902 (int) : min=9 max=625 step=1 default=157 value=157 flags=inactive
exposure_auto_priority 0x009a0903 (bool) : default=0 value=1
A lot of information is printed on it, we don’t need to worry about it, let’s look at the main point 打印了camera ok
:
it means that this camera is indeed real.
video1
liuhuan@liuhuan-G5-5587:~$ v4l2-ctl -d /dev/video1 --all
Driver Info:
Driver name : uvcvideo
Card type : Integrated_Webcam_HD: Integrate
Bus info : usb-0000:00:14.0-5
Driver version : 5.8.18
Capabilities : 0x84a00001
Video Capture
Metadata Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04a00000
Metadata Capture
Streaming
Extended Pix Format
Priority: 2
Format Metadata Capture:
Sample Format : 'UVCH' (UVC Payload Header Metadata)
Buffer Size : 1024
This printed information is obviously much less, and there is no camera ok
wording, indicating that this is a fake camera.
I didn’t find any other methods that can be listed directly. I only found the above difference. If there is a better method, please leave a message.