$ ls -ltrh /dev/video*
crw-rw----+ 1 root video 81, 1 Mai 4 00:17 /dev/video1
crw-rw----+ 1 root video 81, 0 Mai 4 00:17 /dev/video0
这是一台笔记本电脑,所以我猜一个是内置摄像头,一个是屏幕。但我该如何检查哪个?有没有办法获取有关其中一个的更多信息?
答案1
你可以做这个v4l2-ctl
在终端中:
- 打开终端(如果尚未打开)
- 安装实用程序(如果尚未安装)
sudo apt update sudo apt install v4l2-ctl
- 运行实用程序:
您将看到如下输出:v4l2-ctl --list-devices
Integrated Camera (usb-0000:00:3b.0-1.2): /dev/video0
您看到的其中一个视频设备/dev/video*
是虚拟设备。
答案2
有一个名为的包,usbutils
它可以成为一种非常有价值的工具:
sudo apt install usbutils
然后您可以查询任何 USB 设备并获取大量信息:
$ sudo lsusb -v | grep -i webcam -a14
Bus 001 Device 009: ID 1bcf:2b8c Sunplus Innovation Technology Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2 ?
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
idVendor 0x1bcf Sunplus Innovation Technology Inc.
idProduct 0x2b8c
bcdDevice 47.14
iManufacturer 1 SunplusIT Inc
iProduct 2 Integrated_Webcam_HD
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 767
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 14 Video
bFunctionSubClass 3 Video Interface Collection
bFunctionProtocol 0
iFunction 4 Integrated Webcam
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 1 Video Control
bInterfaceProtocol 0
iInterface 4 Integrated Webcam
VideoControl Interface Descriptor:
bLength 13
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdUVC 1.00
wTotalLength 109
dwClockFrequency 48.000000MHz
bInCollection 1
baInterfaceNr( 0) 1
VideoControl Interface Descriptor:
bLength 18
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 1