$ 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
这是一台笔记本电脑,我猜其中一个是内置摄像头,另一个是屏幕。但是我怎么查看哪个是哪个呢?有没有办法获取更多关于它们的信息?
$ 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
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*
中看到的视频设备之一是虚拟设备。
sudo apt install v4l-utils
,对吗? - EnterpriseHP TrueVision HD: HP TrueVision (usb-0000:00:14.0-5):
/dev/video0
/dev/video1
,但我只有一个摄像头。 - Archisman Panigrahiv4l2-ctl
也列出了两个设备(/dev/video0
,/dev/video1
)。我想知道其中一个是否是红外摄像头? - Enterpriseusbutils
的软件包,它可以是一个非常有价值的工具:sudo apt install usbutils
$ 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
-a
(--text
)会接收参数。它似乎和-C
一样工作,它们是等价的吗? - Pablo Bianchi-a#
来指定grep
匹配前后的行数。你可以使用-A#
来指定grep
匹配后的行数。我以前没有使用过grep
中的-C
选项。你用它做什么? - WinEunuuchs2Unix-C
(--context
)是用于上下文的。它似乎与未记录的-a#
完全相同,据我所知。请注意,-a
可能会输出二进制垃圾。 - Pablo Bianchi