pw-v4l2
Expose PipeWire streams as V4L2 devices
TLDR
Run a program
Display help
SYNOPSIS
pw-v4l2
(Note: This is a PipeWire module and is typically not invoked directly by the user via the command line with options, but rather loaded by a PipeWire session manager based on system configuration.)
PARAMETERS
v4l2.source.fd.autodetect
(Boolean) When set to true (default), enables automatic detection and exposure of file descriptor-based V4L2 sources (e.g., /dev/video0) as PipeWire nodes. Configured via PipeWire's module configuration files.
v4l2.sink.loopback
(Boolean) Enables the creation of virtual V4L2 loopback devices, which act as PipeWire sinks. Applications can then write video data to these virtual devices, which can be consumed by other V4L2-compatible applications. Configured via PipeWire's module configuration files.
v4l2.sink.devices
(String Array) Specifies a list of device paths for the virtual V4L2 loopback devices created by the module (e.g., ['/dev/video10']). Only relevant if v4l2.sink.loopback is enabled. Configured via PipeWire's module configuration files.
v4l2.source.devices
(String Array) Specifies a list of specific V4L2 source device paths to expose (e.g., ['/dev/video0']). If not specified, all detected devices are usually handled. Configured via PipeWire's module configuration files.
v4l2.source.width, v4l2.source.height
(Integer) Preferred resolution for a specific V4L2 source. These are hints and the actual resolution depends on device capabilities and application requests. Configured via PipeWire's module configuration files.
v4l2.source.framerate
(Fraction) Preferred framerate for a specific V4L2 source (e.g., '30/1'). Configured via PipeWire's module configuration files.
v4l2.source.format
(String) Preferred pixel format for a specific V4L2 source (e.g., 'YUY2'). Configured via PipeWire's module configuration files.
DESCRIPTION
pw-v4l2 is a crucial PipeWire module designed to integrate Video4Linux2 (V4L2) devices into the PipeWire multimedia graph. It acts as a bridge, exposing physical V4L2 sources, such as webcams, capture cards, or other video input devices, as PipeWire video nodes.
Conversely, pw-v4l2 can also create virtual V4L2 loopback devices, acting as PipeWire sinks. This allows applications to capture video output from PipeWire applications (e.g., screen recording tools, video mixers) as if it were a physical V4L2 camera, enabling complex video routing and processing.
This module is typically loaded automatically by a PipeWire session manager like wireplumber or pipewire-media-session based on system configuration. It handles device enumeration, format negotiation, and stream management, ensuring seamless video integration within the modern Linux desktop environment.
CAVEATS
pw-v4l2 is a PipeWire module, meaning it's primarily designed to be loaded and managed by a PipeWire daemon and its session manager (like wireplumber). Direct execution from the command line is generally for debugging or specific advanced setups and typically offers no command-line arguments for configuration. All configuration is done through PipeWire's module configuration files (e.g., /usr/share/pipewire/pipewire-v4l2.conf or /etc/pipewire/pipewire-v4l2.conf). Proper permissions for accessing V4L2 devices (e.g., user in 'video' group) are essential for its operation.
CONFIGURATION
The behavior of pw-v4l2 is primarily controlled via PipeWire configuration files. These files, typically located in /usr/share/pipewire/ and /etc/pipewire/ (e.g., pipewire-v4l2.conf or module-specific files), contain properties that dictate how the module discovers and exposes V4L2 devices, and whether it creates virtual loopback devices. Changes to these files often require restarting the PipeWire service or its session manager for them to take effect.
USE CASES
pw-v4l2 is essential for applications that rely on webcam input, ensuring they can access physical cameras through the PipeWire infrastructure. It's also vital for creating virtual camera feeds; for instance, broadcasting software like OBS Studio can output its mixed video stream to a PipeWire sink, which pw-v4l2 then exposes as a virtual V4L2 device. This allows other applications (e.g., video conferencing tools) to select this virtual camera as their input, enabling complex video routing and processing workflows.
HISTORY
pw-v4l2 is an integral part of the PipeWire project, which emerged to address the complex multimedia requirements of modern Linux desktops, including low-latency audio/video processing, sandboxing support for applications (like Flatpaks), and unified media handling. PipeWire began development around 2017 and gained significant traction, aiming to replace older frameworks like PulseAudio and JACK for many use cases. The pw-v4l2 module was developed as a core component to seamlessly integrate existing V4L2 hardware and software devices into this new graph-based multimedia system, enabling broad compatibility and advanced video routing capabilities.
SEE ALSO
pipewire(1), wireplumber(1), pipewire-media-session(1), v4l2-ctl(1)