動かざることバグの如し

近づきたいよ 君の理想に

UbuntuでWEBカメラの情報を表示・設定

接続確認

lsusb 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 003: ID 06a5:d001 Divio ProLink DS3303u Webcam
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

ツールのインストール

sudo apt-get install v4l-utils

デバイス情報の表示

-d /dev/video0もしくは-d 0でデバイスを指定する

v4l2-ctl -d /dev/video0 --info
Driver Info (not using libv4l2):
        Driver name   : nw80x
        Card type     : USB Camera (06a5:d001)
        Bus info      : usb-0000:00:1d.0-1
        Driver version: 3.16.7
        Capabilities  : 0x85000001
                Video Capture
                Read/Write
                Streaming
                Device Capabilities
        Device Caps   : 0x05000001
                Video Capture
                Read/Write
                Streaming

より詳細な情報表示

v4l2-ctl -d /dev/video0 --all
Driver Info (not using libv4l2):
        Driver name   : nw80x
        Card type     : USB Camera (06a5:d001)
        Bus info      : usb-0000:00:1d.0-1
        Driver version: 3.16.7
        Capabilities  : 0x85000001
                Video Capture
                Read/Write
                Streaming
                Device Capabilities
        Device Caps   : 0x05000001
                Video Capture
                Read/Write
                Streaming
Priority: 2
Video input : 0 (nw80x: ok)
Format Video Capture:
        Width/Height  : 320/240
        Pixel Format  : 'JPGL'
        Field         : None
        Bytes per Line: 320
        Size Image    : 38400
        Colorspace    : JPEG (JFIF/ITU601)
Streaming Parameters Video Capture:
        Frames per second: invalid (0/0)
        Read buffers     : 2

対応している解像度とフレームレート一覧表示

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

設定もできる

v4l2-ctl -d 0 --set-fmt-video=width=640,height=480 --set-parm=15