我在我的T500 Thinkpad上有一个网络摄像头。我想知道它支持的分辨率。有没有一种方法可以通过软件来找出它(而不必查阅文档)?
v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'JPEG' (JFIF JPEG, compressed)
Size: Discrete 320x240
Size: Discrete 640x480
sudo apt-get install v4l-utils
- supcheese
),保存一个图片并查看分辨率。lsusb
的输出,找到描述摄像头的一行。$ lsusb
Bus 001 Device 002: ID 5986:0241 Acer, Inc BisonCam, NB Pro
...
$ lsusb -s 001:002 -v | egrep "Width|Height"
wWidth 640
wHeight 480
wWidth 1280
wHeight 1024
...
`屏幕宽度 640
屏幕高度 480
屏幕宽度 320
屏幕高度 240
屏幕宽度 800
屏幕高度 600
屏幕宽度 1024
屏幕高度 600
屏幕宽度 1024
屏幕高度 768
屏幕宽度 1280
屏幕高度 800
屏幕宽度 1280
屏幕高度 1024
屏幕宽度 640
屏幕高度 480
屏幕宽度 320
屏幕高度 240
屏幕宽度 800
屏幕高度 600
屏幕宽度 1024
屏幕高度 600
屏幕宽度 1024
屏幕高度 768
屏幕宽度 1280
屏幕高度 800
屏幕宽度 1280
屏幕高度 1024`
我猜可以假设最高的组合是物理分辨率。 - sup-s
选项没有提供任何关于它的额外信息。 - Michael-s
选项选择特定设备,-v
选项提供详细信息。你可以在分页器中浏览这些信息,例如 lsusb -s 001:002 -v | less -i
,然后你可以使用 /width
来搜索尺寸信息。 - Walfffmpeg
实现,它还提供有关视频编码的信息(例如原始格式与MJPEG)。ffmpeg -f video4linux2 -list_formats all -i /dev/video0
示例输出:
...
[video4linux2,v4l2 @ 0x7fa3a8000b40] Raw : yuyv422 : YUYV 4:2:2 : 640x480 320x240 800x600 1024x600 1024x768 1280x800 1280x1024
[video4linux2,v4l2 @ 0x7fa3a8000b40] Compressed: mjpeg : Motion-JPEG : 640x480 320x240 800x600 1024x600 1024x768 1280x800 1280x1024
...
ffmpeg
作为替代方法。 - Benjamin Peter$ gst-device-monitor-1.0
示例输出:
Device found:
name : FHD Camera
class : Video/Source
caps : video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 5/1, 3/1 };
video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)5/1;
video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)20/1;
video/x-raw, format=(string)YUY2, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
image/jpeg, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 25/1, 20/1, 15/1, 10/1, 5/1, 1/1 };
image/jpeg, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
image/jpeg, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
image/jpeg, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
properties:
udev-probed = true
device.bus_path = platform-70090000.xusb-usb-0:2.1:1.0
sysfs.path = /sys/devices/70090000.xusb/usb1/1-2/1-2.1/1-2.1:1.0/video4linux/video0
device.bus = usb
device.subsystem = video4linux
device.vendor.id = 1bcf
device.vendor.name = "Sunplus\\x20IT\\x20Co\\x20"
device.product.id = 2286
device.product.name = "FHD\ Camera"
device.serial = Sunplus_IT_Co_FHD_Camera
device.capabilities = :capture:
device.api = v4l2
device.path = /dev/video0
v4l2.device.driver = uvcvideo
v4l2.device.card = "FHD\ Camera"
v4l2.device.bus_info = usb-70090000.xusb-2.1
v4l2.device.version = 264588 (0x0004098c)
v4l2.device.capabilities = 2216689665 (0x84200001)
v4l2.device.device_caps = 69206017 (0x04200001)
gst-launch-1.0 v4l2src ! ...
gstreamer1.0-plugins-base-apps
中找到它。 - kristopolous这对我有效:
首先获取总线和设备ID:
lsusb
它将打印类似以下内容:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 011: ID 0ac8:3420 Z-Star Microelectronics Corp. Venus USB2.0 Camera
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
wWidth 640
wHeight 480
wWidth 352
wHeight 288
wWidth 320
wHeight 240
wWidth 176
wHeight 144
wWidth 160
wHeight 120
wWidth 800
wHeight 600
wWidth 1280
wHeight 960
wWidth 1280
wHeight 1024
wWidth 1600
wHeight 1200
wWidth( 0) 1600
wHeight( 0) 1200
wWidth( 1) 352
wHeight( 1) 288
wWidth( 2) 320
wHeight( 2) 240
wWidth( 3) 176
wHeight( 3) 144
wWidth( 4) 160
wHeight( 4) 120
wWidth( 5) 800
wHeight( 5) 600
wWidth( 6) 1280
wHeight( 6) 960
wWidth( 7) 1280
wHeight( 7) 1024
wWidth( 8) 640
wHeight( 8) 480
lsusb
解决方案似乎不适用于所有网络摄像头——例如,对于我的Hercules Deluxe,它不会输出宽度和高度。但是cheese
解决方案有效,可在“编辑 > 首选项”下找到可用的分辨率。 - Skippy le Grand Gourou