查看参数
有的时候,我们需要查看USB摄像头的参数,
在终端输入命令:v4l2-ctl -d /dev/video0 --all
例如我的输出是:
nvidia@nvidia:~$ v4l2-ctl -d /dev/video1 --all
Driver Info (not using libv4l2):
Driver name : uvcvideo
Card type : PSI USB CAMERA
Bus info : usb-3610000.xhci-2.1
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 : 1920/1080
Pixel Format : 'MJPG'
Field : None
Bytes per Line : 0
Size Image : 4147200
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 1920, Height 1080
Default : Left 0, Top 0, Width 1920, Height 1080
Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080
Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080
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=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=10 value=10
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=2 value=2
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=1 step=1 default=0 value=0
exposure_auto 0x009a0901 (menu) : min=0 max=3 default=3 value=1
exposure_absolute 0x009a0902 (int) : min=50 max=10000 step=1 default=166 value=50
exposure_auto_priority 0x009a0903 (bool) : default=0 value=0
focus_absolute 0x009a090a (int) : min=0 max=1023 step=1 default=68 value=395 flags=inactive
focus_auto 0x009a090c (bool) : default=1 value=1
可以看到摄像头的所有的参数,并且可以看到摄像头的默认参数。
还有输入v4l2-ctl help 查看不同参数的具体意思
调节参数
v4l2-ctl -d /dev/video1 -c 要调节的参数=166
例如当我要调节曝光exposure_absolute时,可以输入下面命令:
v4l2-ctl -d /dev/video1 -c exposure_absolute=166