Failed to start virtual camera

Njuguna

New Member
Hi,
I use OBS Studio 29.0.2.1 on Linux 12 Debian. I've installed the v4l2loopback-dkms package and at first the virtual camera was running well. After one week of no using OBS the virtual camera doesn't start. In the log files I see


10:16:51.493: Failed to start virtual camera

10:17:25.960: NV12 texture support not available

10:17:25.960: P010 texture support not available

10:17:25.961: Failed to start virtual camera

10:17:28.252: NV12 texture support not available

10:17:28.252: P010 texture support not available

10:17:28.253: Failed to start virtual camera

10:17:29.024: NV12 texture support not available

10:17:29.024: P010 texture support not available

10:17:29.025: Failed to start virtual camera
This modules are loaded:
lsmod | grep v4l2
videobuf2_v4l2 36864 1 uvcvideo
videobuf2_common 73728 4 videobuf2_vmalloc,videobuf2_v4l2,uvcvideo,videobuf2_memops
v4l2loopback_dc 32768 0
videodev 294912 5 videobuf2_v4l2,v4l2loopback_dc,uvcvideo,videobuf2_common
mc 77824 5 videodev,snd_usb_audio,videobuf2_v4l2,uvcvideo,videobuf2_common
Do you a solution for this problem?

Many thanks
Njuguna
 

Njuguna

New Member
The problem is described here https://github.com/obfroject/obs-studio/issues/3929, as I could just find.
After the post is almost two and a half years old, I think it is a certificate of poverty that OBS studio has not found a solution so far webcam plus Droidcam (e.g. for document recording) and the virtual camera for forwarding to a web conference - which is a main function - for To make available.
Or has someone already found a solution from you?

Njuguna
 

AaronD

Active Member
Works for me, on Ubuntu Studio 22.04 LTS, which is based Ubuntu, which is based on Debian, for exactly that use case and that method. Though I'm using the IP Webcam app feeding a browser source in OBS, instead of Droidcam. Wouldn't know what to look for. Does verbose logging give any more clues?
obs --verbose in a terminal.
 

Njuguna

New Member
Works for me, on Ubuntu Studio 22.04 LTS, which is based Ubuntu, which is based on Debian, for exactly that use case and that method.
What exactly works for you? The native situation after OBS installation or any suggestion from above link.

I know that Ubuntu is a fork of Debian Linux. As I said before, I'm using the testing branch, which is Debian 12. Following is the abbreviated Verbose output of the program:

obs --verbose
debug: Found portal inhibitor
debug: Attempted path: share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: share/obs/obs-studio/locale.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale.ini
debug: Attempted path: share/obs/obs-studio/locale/de-DE.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale/de-DE.ini
info: Using preferred locale 'de-DE'
debug: Attempted path: share/obs/obs-studio/themes/Yami.qss
debug: Attempted path: /usr/share/obs/obs-studio/themes/Yami.qss
info: Command Line Arguments: --verbose
info: Using EGL/X11
info: CPU Name: AMD Ryzen 9 5900X 12-Core Processor
info: CPU Speed: 2200.000MHz
info: Physical Cores: 12, Logical Cores: 24
info: Physical Memory: 32007MB Total, 24021MB Free
info: Kernel Version: Linux 6.1.0-6-amd64
info: Distribution: "Debian GNU/Linux" "12"
info: Session Type: x11
info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.21.1
debug: found alternate keycode 62 for OBS_KEY_SHIFT which already has keycode 50
debug: found alternate keycode 105 for OBS_KEY_CONTROL which already has keycode 37
debug: found alternate keycode 190 for OBS_KEY_REDO which already has keycode 137
debug: found alternate keycode 208 for OBS_KEY_VK_MEDIA_PLAY_PAUSE which already has keycode 172
debug: found alternate keycode 215 for OBS_KEY_VK_MEDIA_PLAY_PAUSE which already has keycode 172
debug: found alternate keycode 218 for OBS_KEY_PRINT which already has keycode 107
debug: found alternate keycode 231 for OBS_KEY_CANCEL which already has keycode 136
info: Qt Version: 5.15.8 (runtime), 5.15.8 (compiled)
info: Portable mode: false
debug: Attempted path: share/obs/obs-studio/themes/Dark/no_sources.svg
debug: Attempted path: /usr/share/obs/obs-studio/themes/Dark/no_sources.svg
QMetaObject::connectSlotsByName: No matching signal for on_tbar_position_valueChanged(int)
info: OBS 29.0.2.1-1+b1 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
samples per sec: 48000
speakers: 2
max buffering: 960 milliseconds
buffering type: dynamically increasing
info: ---------------------------------
info: Initializing OpenGL...
debug: Created EGLDisplay 0x561f03bc10c0
info: Loading up OpenGL on adapter NVIDIA Corporation NVIDIA GeForce GT 1030/PCIe/SSE2
info: OpenGL loaded successfully, version 3.3.0 NVIDIA 525.60.11, shading language 3.30 NVIDIA via Cg compiler
info: ---------------------------------
info: video settings reset:
base resolution: 1920x1080
output resolution: 1920x1080
downscale filter: Lanczos
fps: 60/1
format: NV12
YUV mode: Rec. 709/Partial
info: NV12 texture support not available
info: P010 texture support not available
info: Audio monitoring device:
name: Standard
id: default
info: ---------------------------------
debug: ---------------------------------
debug: Loading module: decklink-captions.so
warning: Failed to load 'en-US' text for module: 'decklink-captions.so'
debug: ---------------------------------
debug: Loading module: decklink-output-ui.so
warning: Failed to load 'en-US' text for module: 'decklink-output-ui.so'
debug: ---------------------------------
debug: Loading module: decklink.so
libDeckLinkAPI.so: Kann die Shared-Object-Datei nicht öffnen: Datei oder Verzeichnis nicht gefunden
warning: A DeckLink iterator could not be created. The DeckLink drivers may not be installed
warning: Failed to initialize module 'decklink.so'
debug: ---------------------------------
debug: Loading module: frontend-tools.so
debug: ---------------------------------
debug: Loading module: image-source.so
debug: ---------------------------------
debug: Loading module: linux-alsa.so
debug: ---------------------------------
debug: Loading module: linux-capture.so
debug: ---------------------------------
debug: Loading module: linux-jack.so
debug: ---------------------------------
debug: Loading module: linux-pipewire.so
info: [pipewire] Available captures:
info: [pipewire] - Desktop capture
info: [pipewire] - Window capture
debug: ---------------------------------
debug: Loading module: linux-pulseaudio.so
debug: ---------------------------------
debug: Loading module: linux-v4l2.so
debug: ---------------------------------
debug: Loading module: obs-ffmpeg.so
debug: VAAPI: Initializing display in vaapi_device_h264_supported
debug: Libva: VA-API version 1.17.0
debug: Libva: Trying to open /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so
debug: Libva: va_openDriver() returns -1
error: VAAPI: Failed to initialize display in vaapi_device_h264_supported
info: FFmpeg VAAPI H264 encoding not supported
debug: ---------------------------------
debug: Loading module: obs-filters.so
debug: ---------------------------------
debug: Loading module: obs-outputs.so
debug: ---------------------------------
debug: Loading module: obs-transitions.so
debug: ---------------------------------
debug: Loading module: obs-websocket.so
info: [obs-websocket] [obs_module_load] you can haz websockets (Version: 5.1.0 | RPC Version: 1)
info: [obs-websocket] [obs_module_load] Qt version (compile-time): 5.15.8 | Qt version (run-time): 5.15.8
info: [obs-websocket] [obs_module_load] Linked ASIO Version: 102201
info: [obs-websocket] [obs_module_load] Module loaded.
debug: ---------------------------------
debug: Loading module: obs-x264.so
debug: ---------------------------------
debug: Loading module: rtmp-services.so
debug: ---------------------------------
debug: Loading module: text-freetype2.so
debug: ---------------------------------
debug: Loading module: vlc-video.so
info: [vlc-video]: VLC 3.0.18 Vetinari found, VLC video source enabled
info: ---------------------------------
info: Loaded Modules:
info: vlc-video.so
info: text-freetype2.so
info: rtmp-services.so
info: obs-x264.so
info: obs-websocket.so
info: obs-transitions.so
info: obs-outputs.so
info: obs-filters.so
info: obs-ffmpeg.so
info: linux-v4l2.so
info: linux-pulseaudio.so
info: linux-pipewire.so
info: linux-jack.so
info: linux-capture.so
info: linux-alsa.so
info: image-source.so
info: frontend-tools.so
info: decklink-output-ui.so
info: decklink-captions.so
info: ---------------------------------
QLayout: Attempting to add QLayout "" to OBSBasic "OBSBasic", which already has a layout
QWidget::setTabOrder: 'first' and 'second' must be in the same window
info: ==== Startup complete ===============================================
debug: output 'virtualcam_output' (virtualcam_output) created
debug: output 'adv_file_output' (ffmpeg_muxer) created
debug: encoder 'advanced_video_stream' (obs_x264) created
debug: AAC encoder bitrate mapping:
64 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
96 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
128 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
160 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
192 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
224 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
256 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
288 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
320 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
352 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
384 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
416 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
448 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
480 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
512 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
544 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
576 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
608 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
640 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
672 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
704 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
736 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
768 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
800 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
832 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
864 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
896 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
928 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
960 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
992 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
1024 kbit/s: 'FFmpeg-Standard-AAC-Encoder' (ffmpeg_aac)
debug: encoder 'adv_aac0' (ffmpeg_aac) created
debug: encoder 'adv_aac1' (ffmpeg_aac) created
debug: encoder 'adv_aac2' (ffmpeg_aac) created
debug: encoder 'adv_aac3' (ffmpeg_aac) created
debug: encoder 'adv_aac4' (ffmpeg_aac) created
debug: encoder 'adv_aac5' (ffmpeg_aac) created
debug: encoder 'adv_stream_aac' (ffmpeg_aac) created
debug: encoder 'adv_archive_aac' (ffmpeg_aac) created
debug: service 'default_service' (rtmp_common) created
info: All scene data cleared
info: ------------------------------------------------
debug: private source 'Schnitt' (cut_transition) created
debug: private source 'Überblende' (fade_transition) created
info: pulse-input: Server name: 'PulseAudio (on PipeWire 0.3.65) 15.0.0'
debug: pulse-input: Default output device: 'alsa_output.pci-0000_09_00.4.iec958-stereo.monitor'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_09_00.4.iec958-stereo.monitor' (default)
debug: source 'Desktop-Audio' (pulse_output_capture) created
info: [Loaded global audio device]: 'Desktop-Audio'
info: pulse-input: Server name: 'PulseAudio (on PipeWire 0.3.65) 15.0.0'
info: pulse-input: Audio format: s16le, 32000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_input.usb-046d_HD_Pro_Webcam_C920_6B5B99AF-02.analog-stereo'
debug: source 'Mikrofon-/AUX-Audio' (pulse_input_capture) created
info: [Loaded global audio device]: 'Mikrofon-/AUX-Audio'
 

Njuguna

New Member
Though I'm using the IP Webcam app feeding a browser source in OBS, instead of Droidcam.
I'm not convinced that the behavior of OBS-Studio depends on installing a special app on the connected smartphone.
This smartphone must be made available to the Linux system as a video device, which sometimes happens through the "Android Debug Bridge" (adb). Now the smartphone gets a /dev/videoXX assigned - no matter which app produces the pictures there.
And here's the problem, OBS also wants to assign a special /dev/videoXX to the virtual camera, but can't do it because it's confused that the position is already occupied. That is very simply put what the problem is.

So what works for you with which solution? Just saying "it works for me" isn't very constructive.
 

AaronD

Active Member
It shouldn't insist on a specific /dev/videoXX. Those are supposed to be dynamic, as far as I can tell. If it must be static, then you might see if you can assign them manually to not interfere.

For what it's worth, I have this in a script that runs from root's crontab @reboot:
modprobe v4l2loopback exclusive_caps=1 card_label='OBS Virtual Camera'
I searched OBS's source code for modprobe, and copy/pasted that line verbatim. That way it doesn't ask for my password when I try to start the VCam, despite not running as root. (*never* run it as root!)

Also, IP Webcam does NOT use /dev/videoXX. It uses a browser source instead, pointing to http://<phoneIP>:8080/video That should clear up your conflict by itself.
 

Tuna

Member
I'm not convinced that the behavior of OBS-Studio depends on installing a special app on the connected smartphone.
This smartphone must be made available to the Linux system as a video device, which sometimes happens through the "Android Debug Bridge" (adb). Now the smartphone gets a /dev/videoXX assigned - no matter which app produces the pictures there.
And here's the problem, OBS also wants to assign a special /dev/videoXX to the virtual camera, but can't do it because it's confused that the position is already occupied. That is very simply put what the problem is.

So what works for you with which solution? Just saying "it works for me" isn't very constructive.
Check the the quick reply on this issue.


Does that help / make clear what OBS does?
 

Njuguna

New Member
It shouldn't insist on a specific /dev/videoXX. Those are supposed to be dynamic, as far as I can tell. If it must be static, then you might see if you can assign them manually to not interfere.

For what it's worth, I have this in a script that runs from root's crontab @reboot:
modprobe v4l2loopback exclusive_caps=1 card_label='OBS Virtual Camera'
I searched OBS's source code for modprobe, and copy/pasted that line verbatim. That way it doesn't ask for my password when I try to start the VCam, despite not running as root. (*never* run it as root!)

Also, IP Webcam does NOT use /dev/videoXX. It uses a browser source instead, pointing to http://<phoneIP>:8080/video That should clear up your conflict by itself.
Okay, thanks for the tip about manually extending the v4l2loopback module. I would rather solve that with the crontab script via "/etc/modprobe.d/", at least I have a "droidcam.conf" here:
Code:
options v4l2loopback_dc width=640 height=480

As far as the "IP Webcam" app is concerned, it may be that it can be accessed via the web browser. However, that is not the goal of getting the smartphone output into an OBS scene via the detour "web browser".
Code:
#  v4l2-ctl --list-devices
OBS Virtual Camera (platform:v4l2loopback-000):
        /dev/video3

Droidcam (platform:v4l2loopback_dc-000):
        /dev/video2

HD Pro Webcam C920 (usb-0000:09:00.3-2.2):
        /dev/video0
        /dev/video1
        /dev/media0

This now works for me as a video source in OBS. Many thanks for the support.
 

AaronD

Active Member
Code:
#  v4l2-ctl --list-devices
OBS Virtual Camera (platform:v4l2loopback-000):
        /dev/video3

Droidcam (platform:v4l2loopback_dc-000):
        /dev/video2

HD Pro Webcam C920 (usb-0000:09:00.3-2.2):
        /dev/video0
        /dev/video1
        /dev/media0
Thanks for that! It's amazing how many practically-undocumented commands there are.
(in the sense of their existence, not how they work; once you know they exist, *then* you can read their manuals)

Anyway:
It shouldn't insist on a specific /dev/videoXX. Those are supposed to be dynamic, as far as I can tell. If it must be static, then you might see if you can assign them manually to not interfere.

For what it's worth, I have this in a script that runs from root's crontab @reboot:
modprobe v4l2loopback exclusive_caps=1 card_label='OBS Virtual Camera'
I searched OBS's source code for modprobe, and copy/pasted that line verbatim. That way it doesn't ask for my password when I try to start the VCam, despite not running as root. (*never* run it as root!)
I've updated mine to add video_nr=99. So now the VCam is not fighting for the dynamically-assigned ones. The complete line is now:
modprobe v4l2loopback exclusive_caps=1 card_label='OBS Virtual Camera' video_nr=99
 
Top