Gst Launch 1.0 / Create Pipewire Node V4l2 Linux
Create Pipewire Node V4l2 Linux
Use gst-launch-1.0 to create a PipeWire node from a V4L2 video source on Linux.
$
Terminal gst-launch-1.0 v4l2src device=</dev/video0> ! videoconvert ! pipewiresink mode=provide stream-properties="properties,media.class=Video/Source" client-name=<Virtual Camera> gst-launch-1.0 v4l2src device=</dev/video0> ! videoconvert ! pipewiresink mode=provide stream-properties="properties,media.class=Video/Source" client-name=<Virtual Camera> #!/bin/bash
# Create Pipewire Node V4l2 Linux
gst-launch-1.0 v4l2src device={{/dev/video0}} ! videoconvert ! pipewiresink mode=provide stream-properties="properties,media.class=Video/Source" client-name={{Virtual Camera}} import subprocess
# Create Pipewire Node V4l2 Linux
# Make sure to replace <placeholders> with actual values
def run_command():
cmd = [
"gst-launch-1.0",
"v4l2src",
"device=</dev/video0>",
"!",
"videoconvert",
"!",
"pipewiresink",
"mode=provide",
"stream-properties=\"properties,media.class=Video/Source\"",
"client-name={{Virtual",
"Camera}}"
]
try:
print(f"Executing: {' '.join(cmd)}")
subprocess.run(cmd, check=True)
except subprocess.CalledProcessError as e:
print(f"Error: {e}")
except FileNotFoundError:
print("Error: gst-launch-1.0 not found. Please install it first.")
if __name__ == "__main__":
run_command() When To Use
Use this command to create a virtual camera node from a V4L2 source.
Command Builder
Tune the command before you copy it
$
Generated Command gst-launch-1.0 v4l2src device=</dev/video0> ! videoconvert ! pipewiresink mode=provide stream-properties="properties,media.class=Video/Source" client-name=<Virtual Camera> Terminal Output
Expected runtime feedback
>
Output Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock Command Breakdown
What each part is doing
-
gst-launch-1.0 - Base Command
- The executable that performs this operation. Here it runs Gst Launch 1.0 before the shell applies any redirect operators.
-
</dev/video0> - dev video0
- The value supplied for dev video0.
-
<Virtual Camera> - Virtual Camera
- The value supplied for Virtual Camera.
How To Run
Execution path
- Step 1
Install GStreamer and PipeWire on your Linux system.
- Step 2
Run the command with the appropriate device and client name.
- Step 3
Verify the PipeWire node is created successfully.
Alternative Approaches
Comparable commands in other tools
Alternative video processing tools for the same job.
Cavif / Convert Jpeg To Avif
cavif <path/to/image.jpg> Magick / Create Favicon From Images Different Sizes magick convert <path/to/image1.png path/to/image2.png ...> <path/to/favicon.ico> Dwebp / Convert Webp With Multi Threading dwebp <path/to/input.webp> -o <path/to/output.png> -mt Dwebp / Convert Webp To Specific Filetype dwebp <path/to/input.webp> -bmp|-tiff|-pam|-ppm|-pgm|-yuv -o <path/to/output>