读取usb摄像头支持参数
今天在测试一款板卡usb摄像头时,发现读取的视频流的分辨率和帧率根本达不到厂商的说法,
查看usb摄像头支持参数
安装v4l-utils
sudo apt install v4l-utils
查看参数
sudo v4l2-ctl --all --list-formats-ext
Driver Info (not using libv4l2):
Driver name : uvcvideo
Card type : USB Camera
Bus info : usb-70090000.xusb-2.3
Driver version: 4.9.140
Capabilities : 0x84200001
Video 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 : 1280/720
Pixel Format : 'MJPG'
Field : None
Bytes per Line : 0
Size Image : 1843200
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 1280, Height 720
Default : Left 0, Top 0, Width 1280, Height 720
Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 1280, Height 720
Selection: crop_bounds, Left 0, Top 0, Width 1280, Height 720
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 90.000 (90/1)
Read buffers : 0
brightness 0x00980900 (int) : min=-64 max=64 step=1 default=4 value=4
contrast 0x00980901 (int) : min=0 max=100 step=1 default=50 value=50
saturation 0x00980902 (int) : min=0 max=100 step=1 default=64 value=64
hue 0x00980903 (int) : min=-180 max=180 step=1 default=0 value=0
white_balance_temperature_auto 0x0098090c (bool) : default=1 value=1
gamma 0x00980910 (int) : min=100 max=500 step=1 default=300 value=300
power_line_frequency 0x00980918 (menu) : min=0 max=2 default=1 value=1
white_balance_temperature 0x0098091a (int) : min=2800 max=6500 step=10 default=4600 value=4600 flags=inactive
sharpness 0x0098091b (int) : min=0 max=100 step=1 default=50 value=50
backlight_compensation 0x0098091c (int) : min=0 max=2 step=1 default=0 value=0
exposure_auto 0x009a0901 (menu) : min=0 max=3 default=3 value=3
exposure_absolute 0x009a0902 (int) : min=50 max=10000 step=1 default=83 value=83 flags=inactive
exposure_auto_priority 0x009a0903 (bool) : default=0 value=0
pan_absolute 0x009a0908 (int) : min=-57600 max=57600 step=3600 default=0 value=0
tilt_absolute 0x009a0909 (int) : min=-43200 max=43200 step=3600 default=0 value=0
focus_absolute 0x009a090a (int) : min=0 max=1022 step=1 default=68 value=68 flags=inactive
focus_auto 0x009a090c (bool) : default=1 value=1
zoom_absolute 0x009a090d (int) : min=0 max=3 step=1 default=0 value=0
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'MJPG' (compressed)
Name : Motion-JPEG
Size: Discrete 1280x720
Interval: Discrete 0.011s (90.000 fps)
Size: Discrete 320x180
Interval: Discrete 0.006s (180.000 fps)
Size: Discrete 320x240
Interval: Discrete 0.006s (180.000 fps)
Size: Discrete 424x240
Interval: Discrete 0.006s (180.000 fps)
Size: Discrete 640x360
Interval: Discrete 0.006s (180.000 fps)
Size: Discrete 640x480
Interval: Discrete 0.006s (180.000 fps)
Size: Discrete 960x540
Interval: Discrete 0.011s (90.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.011s (90.000 fps)
Index : 1
Type : Video Capture
Pixel Format: 'YUYV'
Name : YUYV 4:2:2
Size: Discrete 320x240
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 320x180
Interval: Discrete 0.033s (30.000 fps)
可以看到摄像头还是支持的,不过需要设置对应的分辨率以及帧率