Virtual Camera Loopback Device

renthner

New Member
OS: Linux Arch
OBS-Version: obs-studio-git

I'm Using a Canon EOS M50 as Webcam. It's not natively supported, so I created a script to add it as a loopback-webcam.

# Canon-Webcam Login-Script
#!/bin/bash

while true; do
sudo rmmod v4l2loopback # remove the module if it's already loaded
sudo modprobe v4l2loopback exclusive_caps=1 max_buffers=2 card_label="Canon M50" # load the module with the needed parameters
sudo pkill -9 gphoto # kill any gphoto process that may be running
# Starte Kamera und prüfe, ob ein Fehler auftritt
gphoto2 --stdout --capture-movie | \
ffmpeg -i - -vcodec rawvideo -af "hqdn3d" -pix_fmt yuv420p -threads 0 -s:v 1920x1080 -f v4l2 /dev/video2

echo "Fehler aufgetreten, Neustart in 5 Sekunden…" >&2
sleep 5
done
Now, I want to use the virtual camera in OBS, but I get an error when starting the vcam:
Starten der Ausgabe fehlgeschlagen. Bitte überprüfen Sie die Logdatei für Details.
Hinweis: Wenn Sie die NVENC- oder AMD-Kodierer verwenden, stellen Sie sicher, dass Ihre Grafiktreiber aktuell sind.

When I stop the Canon-Script, the vcam is working fine. Does anybody have a solution for this problem?
 

Tuna

Member
OBS always uses the first loopback device for the virtual camera. So create two loopback devices and let the Canon use the second one.
 
Top