Created
August 23, 2025 02:22
-
-
Save eagsalazar/606a415e364c3914626a51299a8f3d87 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install the tools | |
| sudo dnf install v4l2loopback v4l2loopback-utils ffmpeg | |
| # Create the virtual camera device (persistent across reboots) | |
| echo 'v4l2loopback video_nr=10 card_label="Compatible Camera"' | sudo tee /etc/modules-load.d/v4l2loopback.conf | |
| # Load it now | |
| sudo modprobe v4l2loopback video_nr=10 card_label="Compatible Camera" | |
| # Create the bridge (converts NV12 to YUYV which most apps expect) | |
| ffmpeg -f v4l2 -input_format nv12 -i /dev/video0 -pix_fmt yuyv422 -f v4l2 /dev/video10 | |
| Then...create a simple systemd user service: | |
| mkdir -p ~/.config/systemd/user | |
| cat > ~/.config/systemd/user/camera-bridge.service << EOF | |
| [Unit] | |
| Description=Camera Bridge | |
| After=graphical-session.target | |
| [Service] | |
| ExecStart=/usr/bin/ffmpeg -f v4l2 -input_format nv12 -i /dev/video0 -pix_fmt yuyv422 -f v4l2 /dev/video10 | |
| Restart=always | |
| [Install] | |
| WantedBy=default.target | |
| EOF | |
| systemctl --user enable camera-bridge.service | |
| systemctl --user start camera-bridge.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment