日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > linux >内容正文

linux

linux USB摄像头 V4L2工具调试摄像头

發(fā)布時(shí)間:2023/12/20 linux 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux USB摄像头 V4L2工具调试摄像头 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

V4L2工具調(diào)試USB攝像頭

  • 1.v4l2-ctl 常用操作
  • 2 V4L2驅(qū)動(dòng)的ioctl功能詳情

1.v4l2-ctl 常用操作

安裝V4l2工具包

sudo apt install v4l-utils

通過(guò)v4l2查看攝像頭設(shè)備

sudo v4l2-ctl --list-devices

USB2.0 PC CAMERA (usb-0000:00:14.0-3): /dev/video0

USB2.0 PC CAMERA (usb-0000:00:14.0-4): /dev/video1

查看攝像頭所有參數(shù)

sudo v4l2-ctl -d /dev/video0 --all Driver Info (not using libv4l2): Driver name : uvcvideo Card type
USB2.0 PC CAMERA Bus info : usb-0000:00:14.0-3 Driver
version: 4.4.98 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 : 800/600 Pixel Format : ‘MJPG’ Field
None Bytes per Line : 0 Size Image : 960000 Colorspace
Default Transfer Function : Default YCbCr Encoding : Default
Quantization : Default Flags : Crop Capability
Video Capture: Bounds : Left 0, Top 0, Width 800, Height 600
Default : Left 0, Top 0, Width 800, Height 600 Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 800, Height 600
Selection: crop_bounds, Left 0, Top 0, Width 800, Height 600 Streaming
Parameters Video Capture: Capabilities : timeperframe Frames per
second: 30.000 (30/1) Read buffers : 0
brightness (int) : min=0 max=255 step=1 default=128 value=128
contrast (int) : min=0 max=255 step=1 default=128 value=128
saturation (int) : min=0 max=255 step=1 default=120 value=120
hue (int) : min=-127 max=127 step=1 default=0 value=0
gamma (int) : min=1 max=8 step=1 default=5 value=5
gain (int) : min=0 max=65535 step=1 default=16 value=16
power_line_frequency (menu) : min=0 max=2 default=1 value=1
sharpness (int) : min=0 max=255 step=1 default=3 value=3

查看當(dāng)前攝像頭支持的視頻壓縮格式

sudo v4l2-ctl -d /dev/video0 --list-formats

ioctl: VIDIOC_ENUM_FMT Index : 0
Type : Video Capture
Pixel Format: ‘MJPG’ (compressed)
Name : Motion-JPEG

查看攝像頭所支持的分辨率

sudo v4l2-ctl --list-framesizes=MJPG -d /dev/video0

ioctl: VIDIOC_ENUM_FRAMESIZES
Size: Discrete 800x600
Size: Discrete 352x288
Size: Discrete 320x240
Size: Discrete 640x480

v4l2-ctl 命令

v4l2-ctl help

General/Common options:
–all display all information available
-C, --get-ctrl=[,…]
get the value of the controls [VIDIOC_G_EXT_CTRLS]
-c, --set-ctrl==[,=…]
set the value of the controls [VIDIOC_S_EXT_CTRLS]
-D, --info show driver info [VIDIOC_QUERYCAP]
-d, --device= use device instead of /dev/video0
if starts with a digit, then /dev/video is used
-e, --out-device= use device for output streams instead of the
default device as set with --device
if starts with a digit, then /dev/video is used
-h, --help display this help message
–help-all all options
–help-io input/output options
–help-misc miscellaneous options
–help-overlay overlay format options
–help-sdr SDR format options
–help-selection crop/selection options
–help-stds standards and other video timings options
–help-streaming streaming options
–help-tuner tuner/modulator options
–help-vbi VBI format options
–help-vidcap video capture format options
–help-vidout vidout output format options
–help-edid edid handling options
-k, --concise be more concise if possible.
-l, --list-ctrls display all controls and their values [VIDIOC_QUERYCTRL]
-L, --list-ctrls-menus
display all controls and their menus [VIDIOC_QUERYMENU]
-r, --subset=[,,]+
the subset of the N-dimensional array to get/set for control ,
for every dimension an (, ) tuple is given.
-w, --wrapper use the libv4l2 wrapper library.
–list-devices list all v4l devices
–log-status log the board status in the kernel log [VIDIOC_LOG_STATUS]
–get-priority query the current access priority [VIDIOC_G_PRIORITY]
–set-priority=
set the new access priority [VIDIOC_S_PRIORITY]
is 1 (background), 2 (interactive) or 3 (record)
–silent only set the result code, do not print any messages
–sleep= sleep , call QUERYCAP and close the file handle
–verbose turn on verbose ioctl status reporting

2 V4L2驅(qū)動(dòng)的ioctl功能詳情

總結(jié)

以上是生活随笔為你收集整理的linux USB摄像头 V4L2工具调试摄像头的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。