v4l2-ctl

Control video devices. More information: <https://manned.org/v4l2-ctl>.

Install

All systems
curl cmd.cat/v4l2-ctl.sh
Debian Debian
apt-get install v4l-utils
Ubuntu
apt-get install v4l-utils
Alpine
apk add v4l-utils
Arch Arch Linux
pacman -S v4l-utils
image/svg+xml Kali Linux
apt-get install v4l-utils
CentOS
yum install v4l-utils
Fedora
dnf install v4l-utils
Windows (WSL2)
sudo apt-get update sudo apt-get install v4l-utils
Raspbian
apt-get install v4l-utils
Docker
docker run cmd.cat/v4l2-ctl v4l2-ctl powered by Commando

Control video devices. More information: <https://manned.org/v4l2-ctl>.

  • List all video devices:
    v4l2-ctl --list-devices
  • List supported video formats and resolutions of default video device `/dev/video0`:
    v4l2-ctl --list-formats-ext
  • List supported video formats and resolutions of a specific video device:
    v4l2-ctl --list-formats-ext --device path/to/video_device
  • Get all details of a video device:
    v4l2-ctl --all --device path/to/video_device
  • Capture a JPEG photo with a specific resolution from video device:
    v4l2-ctl --device path/to/video_device --set-fmt-video=width=width,height=height,pixelformat=MJPG --stream-mmap --stream-to=path/to/output.jpg --stream-count=1
  • Capture a raw video stream from video device:
    v4l2-ctl --device path/to/video_device --set-fmt-video=width=width,height=height,pixelformat=format --stream-mmap --stream-to=path/to/output --stream-count=number_of_frames_to_capture
  • List all video device's controls and their values:
    v4l2-ctl --list-ctrls --device path/to/video_device
  • Set the value of a video device control:
    v4l2-ctl --device path/to/video_device --set-ctrl=control_name=value

© tl;dr; authors and contributors