uvcdynctrl ユーティリティについて

はじめに

uvcdynctrl ユーティリティについて記述します。

概要

uvcdynctrl は、libwebcam ライブラリパッケージに含まれるユーティリティです。接続する UVC 対応 WEB カメラを制御します。例えば、オートフォーカスやマニュアルフォーカス、露出、ズーム、パン、チルトです。

ここでは、ヘルプ表示、デバイス一覧取得、コントロール一覧取得、各コントロールの管理、フォーマット一覧取得を行います。各コントロールの管理では、Brightness についてキャプチャ画像を比較します。

ヘルプ

$ uvcdynctrl -h
uvcdynctrl 0.2.2

Manage dynamic controls in uvcvideo

Usage: uvcdynctrl [OPTIONS]... [VALUES]...

  -h, --help               Print help and exit
  -V, --version            Print version and exit
  -l, --list               List available cameras
  -i, --import=filename    Import dynamic controls from an XML file
  -a, --addctrl=vid        Import dynamic controls for vid from default location
  -v, --verbose            Enable verbose output  (default=off)
  -d, --device=devicename  Specify the device to use  (default=`video0')
  -c, --clist              List available controls
  -g, --get=control        Retrieve the current control value
  -s, --set=control        Set a new control value
                             (For negative values: -s 'My Control' -- -42)
  -f, --formats            List available frame formats
  -S, --save=filename      Save device controls state to a file
  -L, --load=filename      Load device controls state from a file

デバイス一覧

$ uvcdynctrl -l
Listing available devices:
  video0   HD Pro Webcam C920
    Media controller device /dev/media0 doesn't exist
ERROR: Unable to list device entities: Invalid device or device cannot be opened. (Code: 5)

利用可能なコントロール一覧

$ uvcdynctrl -d video0 -c 
Listing available controls for device video0:
  Brightness
  Contrast
  Saturation
  White Balance Temperature, Auto
  Gain
  Power Line Frequency
  White Balance Temperature
  Sharpness
  Backlight Compensation
  Exposure, Auto
  Exposure (Absolute)
  Exposure, Auto Priority
  Pan (Absolute)
  Tilt (Absolute)
  Focus (absolute)
  Focus, Auto
  Zoom, Absolute

コントロールの値取得と設定

Brightness コントロールの値取得と値設定を行い、キャプチャ画像を比較します。Brightness コントロールの詳細は、uvcdynctrl -c -v コマンドで取得します。

$ uvcdynctrl -d video0 -c -v
Listing available controls for device video0:
  Brightness
    ID      : 0x00000001,
    Type    : Dword,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : [ 0 .. 255, step size: 1 ],
    Default : 128
  :
  : 以下略
$ uvcdynctrl -d video0 -g "Brightness"
128
brightness = 128

brightness = 128

$ uvcdynctrl -d video0 -s "Brightness" 0
brightness = 0

brightness = 0

$ uvcdynctrl -d video0 -s "Brightness" 255
brightness = 255

brightness = 255

利用可能なコントロール一覧の詳細

$ uvcdynctrl -d video0 -c -v
Listing available controls for device video0:
  Brightness
    ID      : 0x00000001,
    Type    : Dword,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : [ 0 .. 255, step size: 1 ],
    Default : 128
  Contrast
    ID      : 0x00000002,
    Type    : Dword,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : [ 0 .. 255, step size: 1 ],
    Default : 128
  Saturation
    ID      : 0x00000004,
    Type    : Dword,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : [ 0 .. 255, step size: 1 ],
    Default : 128
  White Balance Temperature, Auto
    ID      : 0x00000009,
    Type    : Boolean,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : [ 0 .. 1, step size: 1 ],
    Default : 1
  Gain
    ID      : 0x00000003,
    Type    : Dword,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : [ 0 .. 255, step size: 1 ],
    Default : 0
  Power Line Frequency
    ID      : 0x0000000d,
    Type    : Choice,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : { 'Disabled'[0], '50 Hz'[1], '60 Hz'[2] },
    Default : 2
  White Balance Temperature
    ID      : 0x00000008,
    Type    : Dword,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : [ 2000 .. 6500, step size: 1 ],
    Default : 4000
  Sharpness
    ID      : 0x00000007,
    Type    : Dword,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : [ 0 .. 255, step size: 1 ],
    Default : 128
  Backlight Compensation
    ID      : 0x0000000c,
    Type    : Dword,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : [ 0 .. 1, step size: 1 ],
    Default : 0
  Exposure, Auto
    ID      : 0x0000000f,
    Type    : Choice,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : { 'Manual Mode'[1], 'Aperture Priority Mode'[3] },
    Default : 3
  Exposure (Absolute)
    ID      : 0x00000011,
    Type    : Dword,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : [ 3 .. 2047, step size: 1 ],
    Default : 250
  Exposure, Auto Priority
    ID      : 0x00000010,
    Type    : Boolean,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : [ 0 .. 1, step size: 1 ],
    Default : 0
  Pan (Absolute)
    ID      : 0x0000001b,
    Type    : Dword,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : [ -36000 .. 36000, step size: 3600 ],
    Default : 0
  Tilt (Absolute)
    ID      : 0x0000001d,
    Type    : Dword,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : [ -36000 .. 36000, step size: 3600 ],
    Default : 0
  Focus (absolute)
    ID      : 0x00000014,
    Type    : Dword,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : [ 0 .. 250, step size: 5 ],
    Default : 0
  Focus, Auto
    ID      : 0x00000013,
    Type    : Boolean,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : [ 0 .. 1, step size: 1 ],
    Default : 1
  Zoom, Absolute
    ID      : 0x00000018,
    Type    : Dword,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : [ 100 .. 500, step size: 1 ],
    Default : 100

利用可能なフォーマット一覧

$ uvcdynctrl -f
Listing available frame formats for device video0:
Pixel format: YUYV (YUV 4:2:2 (YUYV); MIME type: video/x-raw-yuv)
  Frame size: 640x480
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 160x90
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 160x120
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 176x144
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 320x180
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 320x240
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 352x288
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 432x240
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 640x360
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 800x448
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 800x600
    Frame intervals: 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 864x480
    Frame intervals: 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 960x720
    Frame intervals: 1/15, 1/10, 2/15, 1/5
  Frame size: 1024x576
    Frame intervals: 1/15, 1/10, 2/15, 1/5
  Frame size: 1280x720
    Frame intervals: 1/10, 2/15, 1/5
  Frame size: 1600x896
    Frame intervals: 2/15, 1/5
  Frame size: 1920x1080
    Frame rates: 5
  Frame size: 2304x1296
    Frame rates: 2
  Frame size: 2304x1536
    Frame rates: 2
Pixel format: H264 (H.264)
  Frame size: 640x480
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 160x90
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 160x120
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 176x144
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 320x180
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 320x240
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 352x288
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 432x240
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 640x360
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 800x448
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 800x600
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 864x480
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 960x720
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 1024x576
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 1280x720
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 1600x896
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 1920x1080
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
Pixel format: MJPG (MJPEG; MIME type: image/jpeg)
  Frame size: 640x480
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 160x90
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 160x120
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 176x144
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 320x180
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 320x240
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 352x288
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 432x240
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 640x360
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 800x448
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 800x600
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 864x480
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 960x720
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 1024x576
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 1280x720
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 1600x896
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5
  Frame size: 1920x1080
    Frame intervals: 1/30, 1/24, 1/20, 1/15, 1/10, 2/15, 1/5

Comments are closed.