V4L2-CTL(1)
๐ NAME ๐
v4l2-ctl โ bestie, this is the app for controlling video4linux drivers. It lives in the User Commands section (section 1), and honestly? It's that girl. ๐
๐ธ SYNOPSIS ๐ธ
v4l2-ctl [-h] [-d <dev>] [many other options]
๐ฆ DESCRIPTION ๐ฆ
Okay so, real talk: the v4l2-ctl tool is how you control video4linux devices. And when I say devices I mean video, vbi, radio or swradio, and both input and output. ๐น๐ป
It can control, like, almost any aspect of these devices โ we're talking the full V4L2 API, no crumbs left. She does it all. Periodt. ๐
โจ OPTIONS โจ
So many options, so little time. Let's get into it, bestie. ๐ซถ
-A,--list-devicesโ Lists every v4l device, slay. But wait: if-zwas given, then she only lists the devices of the media device whose bus info string matches whatever you put in the-zoption. ๐ฏ-d,--device<dev>โ Use device<dev>as the V4L2 device. If<dev>starts with a digit, then/dev/video<dev>is used. Otherwise, if-zwas specified earlier, then<dev>is the entity name or interface ID (if prefixed with0x) as found in the topology of the media device with the bus info string as specified by the-zoption. โจ-v,--verboseโ Turn on verbose reporting. She will simply tell you everything. ๐ฃ๏ธ--versionโ Show version information. ๐-w,--wrapperโ Use thelibv4l2wrapper library for all V4L2 device accesses. By defaultv4l2-ctlwill directly access the V4L2 device, but with this option all access will go via this wrapper library. It's giving middle-man energy, but make it official. ๐-h,--helpโ Prints the help message. ๐--help-ioโ Prints the help message for all options that get/set/list inputs and outputs, both video and audio. ๐--help-metaโ Prints the help message for all options that get/set/list metadata formats. ๐ท๏ธ--help-miscโ Prints the help message for miscellaneous options. The random grab-bag section, iconic. ๐ฒ--help-overlayโ Prints the help message for all options that get/set/list overlay and framebuffer formats. ๐ผ๏ธ--help-sdrโ Prints the help message for all options that get/set/list software defined radio formats. ๐ก--help-selectionโ Prints the help message for all options that deal with selections (cropping and composing). โ๏ธ--help-stdsโ Prints the help message for all options that deal with SDTV standards and Digital Video timings. ๐บ--help-streamingโ Prints the help message for all options that deal with streaming. ๐--help-subdevโ Prints the help message for all options that deal withv4l-subdevXdevices. ๐งฉ--help-tunerโ Prints the help message for all options that deal with tuners and modulators. ๐๏ธ--help-vbiโ Prints the help message for all options that get/set/list VBI formats. ๐ผ--help-vidcapโ Prints the help message for all options that get/set/list video capture formats. ๐ฅ--help-vidoutโ Prints the help message for all options that get/set/list video output formats. ๐ค--help-edidโ Prints the help message for all options that get/set EDIDs. ๐ฅ๏ธ--help-allโ Prints the help message for all options. Literally all of them. The whole menu. ๐--allโ Display all information available. No secrets between us. ๐-C,--get-ctrl<ctrl>[,<ctrl>...]โ Get the value of the controls [VIDIOC_G_EXT_CTRLS]. ๐ฌ-c,--set-ctrl<ctrl>=<val>[,<ctrl>=<val>...]โ Set the value of the controls [VIDIOC_S_EXT_CTRLS]. ๐ง-D,--infoโ Show driver info [VIDIOC_QUERYCAP]. ๐ชช-e,--out-device<dev>โ Use device<dev>for output streams instead of the default device as set with--device. If<dev>starts with a digit, then/dev/video<dev>is used. Otherwise if-zwas specified earlier, then<dev>is the entity name or interface ID (if prefixed with0x) as found in the topology of the media device with the bus info string as specified by the-zoption. ๐ฎ-E,--export-device<dev>โ Use device<dev>for exporting DMA buffers. If<dev>starts with a digit, then/dev/video<dev>is used. Otherwise if-zwas specified earlier, then<dev>is the entity name or interface ID (if prefixed with0x) as found in the topology of the media device with the bus info string as specified by the-zoption. ๐ฆ-z,--media-bus-info<bus-info>โ Find the media device with the given<bus-info>string. If set, then-d,-eand-Eoptions can use the entity name or interface ID to refer to the device nodes. Example:
v4l2-ctl -z platform:vivid-000 -d vivid-000-vid-cap
๐โจ
-k,--conciseโ Be more concise if possible. Less yapping, same tea. โ-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<ctrl>[,<offset>,<size>]+โ The subset of the N-dimensional array to get/set for control<ctrl>, for every dimension an (<offset>,<size>) tuple is given. N-dimensional, she's multidimensional, she contains multitudes. ๐ซ--list-devices-input<name>โ Same as--list-devices, but only show devices with a current input name that matches<name>. ๐--list-devices-output<name>โ Same as--list-devices, but only show devices with a current output name that matches<name>. ๐--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<prio>โ Set the new access priority [VIDIOC_S_PRIORITY].<prio>is1(background),2(interactive) or3(record). Pick your fighter. ๐ฎ--silentโ Only set the result code, do not print any messages. ๐คซ--sleep<secs>โ Sleep<secs>, callQUERYCAPand close the file handle. Nap, vibe check, exit. ๐ด
๐ EXIT STATUS ๐
On success, it returns 0. Otherwise, it will return the error code. That's it, that's the whole status report. ๐ซก
๐ EXAMPLES ๐
Query the device information of /dev/video1:
v4l2-ctl -d1 -D
Stream video using MMAP stream I/O from /dev/video0:
v4l2-ctl -d0 --stream-mmap
Stream one frame of video from /dev/video0 and store it in a file:
v4l2-ctl --stream-mmap --stream-count=1 --stream-to=file.raw
Stream video from /dev/video0 and stream it over the network:
v4l2-ctl --stream-mmap --stream-to-host <hostname>
Use qvidcap -p on the host to view the video. ๐
Stream video from /dev/video0 using DMABUFs exported from /dev/video2:
v4l2-ctl --stream-dmabuf --export-device /dev/video2
Stream video from a memory-to-memory device:
v4l2-ctl --stream-mmap --stream-out-mmap
Stream video from a capture video device (/dev/video1) to an output video device (/dev/video2):
v4l2-ctl -d1 --stream-mmap --out-device /dev/video2 --stream-out-dmabuf
๐ BUGS ๐
This manual page is a work in progress. She's a draft, she's growing, we respect the journey. ๐ฑ
Bug reports or questions about this utility should be sent to the linux-media@vger.kernel.org mailinglist. They're lovely, go say hi. ๐
๐ and that's the whole page, bestie โ go forth and control those video4linux devices, you absolute icon. ๐
This was brought to you by v4l-utils 1.32.0, dated March 2015, and it's still serving looks. ๐โจ
๐ฆ where this page comes from
- alpine 3.24: v4l-utils-doc 1.32.0-r1 ยท LGPL-2.0-or-later
- arch rolling: v4l-utils 1.32.0-2 ยท LGPL
- fedora 43: v4l-utils 1.32.0-1.fc43 ยท GPL-2.0-or-later AND GPL-2.0-only AND (GPL-2.0-only OR BSD-3-Clause) AND LicenseRef-Fedora-Public-Domain AND HPND-sell-variant
- fedora 44: v4l-utils 1.32.0-3.fc44 ยท GPL-2.0-or-later AND GPL-2.0-only AND (GPL-2.0-only OR BSD-3-Clause) AND LicenseRef-Fedora-Public-Domain AND HPND-sell-variant
- nixos 26.05: v4l-utils 1.32.0
- nixpkgs unstable: v4l-utils 1.32.0
- ubuntu resolute: v4l-utils 1.32.0-2ubuntu1
- ubuntu stonking: v4l-utils 1.32.0-5ubuntu1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms