Skip to content

v4l2 Virtual camera - Loopback device conflicts (Including droidcam) #3929

Open

Description

@topongo

Platform

Operating system and version: Arch Linux - Rolling
OBS Studio version: 26.1.0.r9

Expected Behavior

Clicking on "Start Virtual Camera" button should start the virtual cam flawlessly

Current Behavior

Pressing the button does not create any effect.

Steps to Reproduce

  1. Install droidcam from @dev47apps**
  2. Install obs-studio-git from AUR
  3. Remove the old CatxFish/obs-v4l2sink plugin
  4. Install v4l2loopback-dkms
  5. Start OBS and click "Start Virtual Camera" button.

Additional information

The log says "warning: Failed to start virtual camera" when clicking on the button.
I've installed droidcam alongside OBS, and it currently uses the /dev/video0 device. I thought maybe obs is trying to use that device and it conflicts with droidcam, but disabling (not removing) droidcam doesn't solve the issue.

Edit:
I've tried removing droidcam, it turns out that they were indeed in conflict. Removing droidcam solves the issue, reinstalling it works fine, but as long as I reboot droidcam takes over /dev/video0 and I could not find any other ways than removin and reinstalling droidcam... every reboot.
It's solved in a way but that's not very practical.

Activity

  1. changed the title [-]Virtual camera fails to start[/-] [+]Virtual camera fails to start due to Droidcam (or maybe other v42l devices)[/+] on Dec 18, 2020
  2. pardomi commented on Dec 20, 2020

    @pardomi

    I am experiencing the same issue.

    Platform
    Operating system and version: Kubuntu 20.10
    OBS Studio version: 26.1

    Expected Behavior
    Clicking on "Start Virtual Camera" button should start the virtual cam flawlessly

    Current Behavior
    Pressing the button does not create any effect. (button text remains "Start Virtual Camera")

    Steps to Reproduce
    Install obs-studio 26.1 from ppa:obsproject/obs-studio
    Install v4l2loopback-dkms (previously installed)
    Start OBS and click "Start Virtual Camera" button.

    Additional information

    • The log says "warning: Failed to start virtual camera" when clicking on the button.
    • I do not have droidcam or any other camera manipulation software installed (as far as I know)
    • I had a previous version of OBS Studio installed (from Ubuntu 20.10 repository - uninstalled before installing 26.1 from PPA).
    Log File Contents
    
    03:19:54 PM.696: CPU Name: Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
    03:19:54 PM.696: CPU Speed: 1830.528MHz
    03:19:54 PM.696: Physical Cores: 2, Logical Cores: 4
    03:19:54 PM.696: Physical Memory: 11850MB Total, 2914MB Free
    03:19:54 PM.696: Kernel Version: Linux 5.8.0-33-generic
    03:19:54 PM.696: Distribution: "Ubuntu" "20.10"
    03:19:54 PM.696: Session Type: x11
    03:19:54 PM.697: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.20.9
    03:19:54 PM.697: Portable mode: false
    03:19:54 PM.754: OBS 26.1.0 (linux)
    03:19:54 PM.754: ---------------------------------
    03:19:54 PM.841: ---------------------------------
    03:19:54 PM.841: audio settings reset:
    03:19:54 PM.841: 	samples per sec: 48000
    03:19:54 PM.841: 	speakers:        2
    03:19:54 PM.850: ---------------------------------
    03:19:54 PM.850: Initializing OpenGL...
    03:19:54 PM.903: Loading up OpenGL on adapter Intel Mesa Intel(R) HD Graphics 620 (KBL GT2)
    03:19:54 PM.903: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 20.2.1, shading language 4.60
    03:19:54 PM.919: ---------------------------------
    03:19:54 PM.919: video settings reset:
    03:19:54 PM.919: 	base resolution:   1600x900
    03:19:54 PM.919: 	output resolution: 1280x720
    03:19:54 PM.919: 	downscale filter:  Bicubic
    03:19:54 PM.919: 	fps:               30/1
    03:19:54 PM.919: 	format:            NV12
    03:19:54 PM.919: 	YUV mode:          709/Partial
    03:19:54 PM.919: NV12 texture support not available
    03:19:54 PM.921: Audio monitoring device:
    03:19:54 PM.921: 	name: Default
    03:19:54 PM.921: 	id: default
    03:19:54 PM.921: ---------------------------------
    03:19:54 PM.923: Failed to load 'en-US' text for module: 'decklink-captions.so'
    03:19:54 PM.925: Failed to load 'en-US' text for module: 'decklink-ouput-ui.so'
    03:19:55 PM.030: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
    03:19:55 PM.030: No blackmagic support
    03:19:55 PM.039: [obs-browser]: Version 2.9.1
    03:19:55 PM.039: [obs-browser]: CEF Version 76.1.13+gf19c584+chromium-76.0.3809.132
    03:19:55 PM.070: os_dlopen(libnvidia-encode.so.1->libnvidia-encode.so.1): libnvidia-encode.so.1: cannot open shared object file: No such file or directory
    03:19:55 PM.070: 
    03:19:55 PM.070: FFMPEG VAAPI supported
    03:19:55 PM.093: VLC found, VLC video source enabled
    03:19:55 PM.094: ---------------------------------
    03:19:55 PM.094:   Loaded Modules:
    03:19:55 PM.094:     vlc-video.so
    03:19:55 PM.094:     text-freetype2.so
    03:19:55 PM.094:     rtmp-services.so
    03:19:55 PM.094:     obs-x264.so
    03:19:55 PM.094:     obs-vst.so
    03:19:55 PM.094:     obs-transitions.so
    03:19:55 PM.094:     obs-outputs.so
    03:19:55 PM.094:     obs-libfdk.so
    03:19:55 PM.094:     obs-filters.so
    03:19:55 PM.094:     obs-ffmpeg.so
    03:19:55 PM.094:     obs-browser.so
    03:19:55 PM.094:     linux-v4l2.so
    03:19:55 PM.094:     linux-pulseaudio.so
    03:19:55 PM.094:     linux-jack.so
    03:19:55 PM.094:     linux-decklink.so
    03:19:55 PM.094:     linux-capture.so
    03:19:55 PM.094:     linux-alsa.so
    03:19:55 PM.094:     image-source.so
    03:19:55 PM.094:     frontend-tools.so
    03:19:55 PM.094:     decklink-ouput-ui.so
    03:19:55 PM.094:     decklink-captions.so
    03:19:55 PM.094: ---------------------------------
    03:19:55 PM.094: os_dlopen(../obs-plugins/obs-browser->../obs-plugins/obs-browser.so): ../obs-plugins/obs-browser.so: cannot open shared object file: No such file or directory
    03:19:55 PM.094: 
    03:19:55 PM.094: ==== Startup complete ===============================================
    03:19:55 PM.097: All scene data cleared
    03:19:55 PM.097: ------------------------------------------------
    03:19:55 PM.106: pulse-input: Server name: 'pulseaudio 13.99.2'
    03:19:55 PM.107: pulse-input: Audio format: s16le, 48000 Hz, 2 channels
    03:19:55 PM.107: pulse-input: Started recording from 'alsa_output.pci-0000_00_1f.3.analog-stereo.monitor'
    03:19:55 PM.107: [Loaded global audio device]: 'Desktop Audio'
    03:19:55 PM.110: pulse-input: Server name: 'pulseaudio 13.99.2'
    03:19:55 PM.111: pulse-input: Audio format: s16le, 48000 Hz, 2 channels
    03:19:55 PM.111: pulse-input: Started recording from 'alsa_input.pci-0000_00_1f.3.analog-stereo'
    03:19:55 PM.111: [Loaded global audio device]: 'Mic/Aux'
    03:19:55 PM.111: v4l2-input: Start capture from /dev/video0
    03:19:55 PM.226: v4l2-input: Input: 0
    03:19:55 PM.234: v4l2-input: Resolution: 640x480
    03:19:55 PM.234: v4l2-input: Pixelformat: YUYV
    03:19:55 PM.234: v4l2-input: Linesize: 1280 Bytes
    03:19:55 PM.234: v4l2-input: Framerate: 30.00 fps
    03:19:55 PM.235: Switched to scene 'Scene'
    03:19:55 PM.235: ------------------------------------------------
    03:19:55 PM.235: Loaded scenes:
    03:19:55 PM.235: - scene 'Scene':
    03:19:55 PM.235:     - source: 'Video Capture Device (V4L2)' (v4l2_input)
    03:19:55 PM.235: ------------------------------------------------
    03:19:55 PM.665: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds (source: Mic/Aux)
    03:19:55 PM.665: 
    03:20:01 PM.687: Failed to start virtual camera
    03:20:07 PM.038: ==== Shutting down ==================================================
    03:20:07 PM.056: v4l2-input: Stopped capture after 354 frames
    03:20:07 PM.098: pulse-input: Stopped recording from 'alsa_output.pci-0000_00_1f.3.analog-stereo.monitor'
    03:20:07 PM.098: pulse-input: Got 2073 packets with 487220 frames
    03:20:07 PM.098: pulse-input: Stopped recording from 'alsa_input.pci-0000_00_1f.3.analog-stereo'
    03:20:07 PM.098: pulse-input: Got 1220 packets with 574616 frames
    03:20:07 PM.100: All scene data cleared
    03:20:07 PM.100: ------------------------------------------------
    03:20:07 PM.232: [Scripting] Total detached callbacks: 0
    03:20:07 PM.243: Freeing OBS context data
    03:20:07 PM.259: == Profiler Results =============================
    03:20:07 PM.259: run_program_init: 699.53 ms
    03:20:07 PM.259:  ┣OBSApp::AppInit: 2.373 ms
    03:20:07 PM.259:  ┃ ┗OBSApp::InitLocale: 1.074 ms
    03:20:07 PM.259:  ┗OBSApp::OBSInit: 622.338 ms
    03:20:07 PM.259:    ┣obs_startup: 1.475 ms
    03:20:07 PM.260:    ┗OBSBasic::OBSInit: 477.28 ms
    03:20:07 PM.260:      ┣OBSBasic::InitBasicConfig: 0.088 ms
    03:20:07 PM.260:      ┣OBSBasic::ResetAudio: 0.127 ms
    03:20:07 PM.260:      ┣OBSBasic::ResetVideo: 79.832 ms
    03:20:07 PM.260:      ┣OBSBasic::InitOBSCallbacks: 0.004 ms
    03:20:07 PM.260:      ┣OBSBasic::InitHotkeys: 0.043 ms
    03:20:07 PM.260:      ┣obs_load_all_modules: 172.504 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(decklink-captions.so): 0.032 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(decklink-ouput-ui.so): 1.016 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(frontend-tools.so): 74.543 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(image-source.so): 0.006 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(linux-alsa.so): 0.003 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(linux-capture.so): 0.303 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(linux-decklink.so): 0.188 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(linux-jack.so): 0.001 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(linux-pulseaudio.so): 0.001 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(linux-v4l2.so): 2.458 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(obs-browser.so): 0.062 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(obs-ffmpeg.so): 0.299 ms
    03:20:07 PM.260:      ┃ ┃ ┗nvenc_check: 0.256 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(obs-filters.so): 0.018 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(obs-libfdk.so): 0.002 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(obs-outputs.so): 0.004 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(obs-transitions.so): 0.009 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(obs-vst.so): 0.006 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(obs-x264.so): 0.004 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(rtmp-services.so): 0.635 ms
    03:20:07 PM.260:      ┃ ┣obs_init_module(text-freetype2.so): 0.021 ms
    03:20:07 PM.260:      ┃ ┗obs_init_module(vlc-video.so): 2.482 ms
    03:20:07 PM.260:      ┣OBSBasic::ResetOutputs: 0.144 ms
    03:20:07 PM.260:      ┣OBSBasic::CreateHotkeys: 0.03 ms
    03:20:07 PM.261:      ┣OBSBasic::InitService: 1.079 ms
    03:20:07 PM.261:      ┣OBSBasic::InitPrimitives: 0.197 ms
    03:20:07 PM.261:      ┗OBSBasic::Load: 140.113 ms
    03:20:07 PM.261: obs_hotkey_thread(25 ms): min=0.086 ms, median=0.31 ms, max=70.343 ms, 99th percentile=6.86 ms, 99.5885% below 25 ms
    03:20:07 PM.261: audio_thread(Audio): min=0 ms, median=0.079 ms, max=2.966 ms, 99th percentile=0.525 ms
    03:20:07 PM.261: obs_graphics_thread(33.3333 ms): min=0.017 ms, median=1.388 ms, max=113.687 ms, 99th percentile=16.17 ms, 99.7275% below 33.333 ms
    03:20:07 PM.261:  ┣tick_sources: min=0 ms, median=0.012 ms, max=113.6 ms, 99th percentile=0.04 ms
    03:20:07 PM.261:  ┣output_frame: min=0.008 ms, median=0.558 ms, max=1.6 ms, 99th percentile=1.525 ms
    03:20:07 PM.261:  ┃ ┗gs_context(video->graphics): min=0.007 ms, median=0.558 ms, max=1.598 ms, 99th percentile=1.525 ms
    03:20:07 PM.261:  ┃   ┣render_video: min=0.004 ms, median=0.439 ms, max=1.348 ms, 99th percentile=1.312 ms
    03:20:07 PM.261:  ┃   ┃ ┗render_main_texture: min=0.004 ms, median=0.433 ms, max=1.345 ms, 99th percentile=1.275 ms
    03:20:07 PM.261:  ┃   ┗gs_flush: min=0 ms, median=0.08 ms, max=0.408 ms, 99th percentile=0.366 ms
    03:20:07 PM.261:  ┗render_displays: min=0.002 ms, median=0.672 ms, max=18.786 ms, 99th percentile=15.498 ms
    03:20:07 PM.261: =================================================
    03:20:07 PM.261: == Profiler Time Between Calls ==================
    03:20:07 PM.261: obs_hotkey_thread(25 ms): min=25.157 ms, median=25.414 ms, max=95.456 ms, 64.1237% within ±2% of 25 ms (0% lower, 35.8763% higher)
    03:20:07 PM.261: obs_graphics_thread(33.3333 ms): min=19.609 ms, median=33.332 ms, max=113.69 ms, 98.9071% within ±2% of 33.333 ms (0.546448% lower, 0.546448% higher)
    03:20:07 PM.261: =================================================
    03:20:07 PM.275: Number of memory leaks: 0
    
    
  3. pardomi commented on Dec 22, 2020

    @pardomi

    It seems the issue was that "modprobe v4l2loopback" assigned /dev/video99 to the virtual camera. Removing v4l2loopback and then manually assigning the next available number (in my case /dev/video2) resulting in the virtual camera working.

    I wonder if there is a way to force OBS to use /dev/video99.

  4. topongo commented on Dec 22, 2020

    @topongo
    Author

    It seems the issue was that "modprobe v4l2loopback" assigned /dev/video99 to the virtual camera. Removing v4l2loopback and then manually assigning the next available number (in my case /dev/video2) resulting in the virtual camera working.

    I wonder if there is a way to force OBS to use /dev/video99.

    You wrote about a "modprobe v4l2loopback" and a /dev/video99, but you actually never mentioned them before, what did you mean?

  5. pardomi commented on Dec 22, 2020

    @pardomi

    I forgot that I had to run "modprobe v4l2loopback" in order for the "Start Virtual Camera" button to appear. Or at least, the button did not appear until after I ran that command. I found I had to run that command when experimenting with uninstalling and reinstalling v4l2loopback-dkms as well as OBS.

  6. topongo commented on Dec 22, 2020

    @topongo
    Author

    I forgot that I had to run "modprobe v4l2loopback" in order for the "Start Virtual Camera" button to appear. Or at least, the button did not appear until after I ran that command. I found I had to run that command when experimenting with uninstalling and reinstalling v4l2loopback-dkms as well as OBS.

    I see. I've noticed something else: maybe it can be a issue with the propting for elevated rigths, 'cause without root access obs has no way to configure a new v4l2loopback device. So my guess is that obs can't prompt you for elevation, then it fails to register a new virtual camera and consequently fails to start it.

  7. changed the title [-]Virtual camera fails to start due to Droidcam (or maybe other v42l devices)[/-] [+]Virtual camera fails to start due to Droidcam (or maybe other v4l2loopback devices)[/+] on Dec 22, 2020
  8. lbriais commented on Dec 25, 2020

    @lbriais

    I have "almost" the same issue...

    Although for me OBS reports that the virtual camera is actually started:

    [...]
    18:04:23.524: Virtual camera started
    18:04:23.531: ==== Virtual Camera Start ==========================================
    18:05:43.722: Output 'virtualcam_output': stopping
    18:05:43.722: Output 'virtualcam_output': Total frames output: 2404
    18:05:43.722: Output 'virtualcam_output': Total drawn frames: 2406
    18:05:43.722: ==== Virtual Camera Stop ===========================================
    18:05:43.724: Virtual camera stopped
    18:05:45.202: ==== Shutting down ====q==============================================
    [...]
    

    I can't see the output in any of the virtual cameras of my system.

    The point is I have multiple "virtual" cameras already:

    $ v4l2-ctl --list-devices      
    Virtual akvcam (out) (platform:akvcam-0):
    	/dev/video0
    
    Virtual akvcam (platform:akvcam-1):
    	/dev/video1
    
    Virtual Camera (platform:v4l2loopback-000):
    	/dev/video3
    
    Droidcam (platform:v4l2loopback_dc-000):
    	/dev/video2
    
    UVC Camera (046d:0809) (usb-0000:00:14.0-2):
    	/dev/video4
    
    • The two firsts are created by the akvcam module that is used by webcamoid.
    • The third one is the one that OBS should use (it is not named "OBS Virtual Camera" because I created it in the modprobe conf file... Anyways I checked the OBS code and it seems that the name "OBS Virtual Camera" is never used elsewhere but in the function creating the v4l2loopback conf.).
    • The fourth one is easy to guess.
    • The last one is my physical camera.

    And of course that order changes across reboots, as reported multiple times.

    The problem seems that the code is checking the fact the v4l2loopback module is loaded, but I have no idea how it determines which device to actually use... I 'm guessing the first one.

    I tried to use any of the virtual cameras to check if it was not outputing to the wrong virtual camera, but no... It just reports the virtual cam is started and issues no error, while it evidently doesn't work.


    I am runnning Ubuntu 18.04 on this machine

    OBS 26.1.0 (64)

    FYI, with the previous OBS release I was using the obs-v4l2sink plugin and it was fully working (I removed everything regarding this plugin when I upgraded to this version of OBS).

    I hope this helps as it's clearly a blocking issue, I am considering falling back, but would definitely prefer to have OBS virtual camera working with no plugin.

    I think OBS should have a config flag to specify which virtual camera to use (it was the case with the plugin). Be it by path, by id, or by whatever is secondary. Even if with the plugin, it was painful to each time check if the /dev/videox used was the correct one after a reboot, it was not blocking at all, which it is now...

  9. mattboy9921 commented on Dec 26, 2020

    @mattboy9921

    Using Arch - Rolling, OBS 26.1.0.r20. Can confirm, removing Droidcam and rebooting fixed my issue and Virtual Camera is working beautifully now.

  10. lbriais commented on Dec 26, 2020

    @lbriais

    I confirm that removing all virtual cameras is a workaround (clearly not a fix).
    In my case I had to remove both akvcam and v4l2loopback_dc (the module used by Droidcam) modules and the the OBS virtual camera started working. But I insist this is no fix!

    The real fix would be to provide a way to specify which v4l2 camera to use as virtual camera, like it was the case with the plugin it supercedes.

    @topongo I suggest you modify the issue title once again to:

    "Virtual camera fails to start due to the presence of any v4l2loopback device other than the one expected by OBS"

    As it is confirmed, akvcam (which is another flavour of v4l2loopback) has to be removed as well...

  11. lbriais commented on Dec 26, 2020

    @lbriais

    A much better workaround until this is fixed is to actually continue using the obs-v4l2sink plugin which still allows selecting the relevant virtual camera to use.

    Just tested with all modules I use actually loaded and it works (like with previous versions of OBS)...

  12. WizardCM commented on Dec 26, 2020

    @WizardCM
    Member

    Out of curiosity, how do akvcam and droidcam handle the mapping? Is there something we could be doing better automatically?

  13. lbriais commented on Dec 26, 2020

    @lbriais

    I am afraid that, for that, you will have to have a look at their respective repos...
    I am just a user in this case.

    The point is both akvcam and droidcam use their own modules (akvcam for Webcamoid and v4l2loopback_dc for Droidcam) which are somehow derived from v4l2loopback but with at least the name differing... I guess this is what they use to target the correct devices.

    In the case of OBS, as it relies on the generic v4l2loopback, I doubt something fully automated could be really achieved unless maybe only one device exists using that module. The best way is clearly to allow to specify which one to use in the OBS config, and to improve regarding the mechanism currently existing within the plugin, use something else than the /dev/videox to ensure consistency across reboots...

    Maybe a possibility for something fully automated would be that OBS provides its own forked flavour of the v4l2loopback module to be able to rely on the module name, but honestly I think that this pathway should be avoided.

  14. pokgak commented on Dec 30, 2020

    @pokgak

    I'm currently using OBS compiled from source (OBS Studio - 26.1.0-15-g60fed63d6) on elementary (Ubuntu 18.04 base) with the droidcam plugin but not the v4l2loopback_dc. Compiled v4l2loopback myself and in /etc/modprobe.d I have a file v4l2loopback.conf with the following content:

    options v4l2loopback devices=1 video_nr=10 card_label="OBS Virtualcam" exclusive_caps=1
    

    Works perfectly for me.

  15. JohnDeeBDD commented on Dec 31, 2020

    @JohnDeeBDD

    I'm having the same issue. For me at least, it's that I can't select WHICH device to output to. My DSLR is a loopback device, and OBS 26 is overwriting it.

    Previously, I could select which v4l2loopback device to output to. After updating to OBS 26, with the new "Start Virtual Camera", I can only output to the first v4l2loopback device. Is there a setting somewhere? How can I select the output path of the virtual camera?

    Details:
    I'm using a Canon DSLR to USB3 via g2photo & v4l2loopback. This is itself a v4l2loopback device. When I run "v4l2-ctl --list-devices", it lists two devices. I then use g2photo to send a stream from the camera to /dev/video0 . For OBS to detect the camera, it has to be running into a loopback device BEFORE OBS starts. The issue is that since I can't select where to send OBS virtual camera output path, it is overwriting the camera with the output. This is how I output OBS into something like Zoom. It was working fine with OBS 25.

    Has the feature: "ability to select which v4l2loopback device" been overlooked?

    Definitely, the ability to carry over the setting from the plugin to OBS 26 either isn't there or isn't working.

  16. 32 remaining items

  17. ickedude commented on Sep 7, 2022

    @ickedude

    I am using OBS to do some filtering before using the stream in Microsoft Teams. My Pipeline looks like this:
    /dev/video0 -> python opencv -> /dev/video12 -> obs -> /dev/video11 -> teams

    I loaded the v4l2loopback module with the option below and had the same problems as described in this issue.
    modprobe v4l2loopback devices=2 exclusive_caps=1 video_nr=11,12 card_label=obs,py

    After some weeks I came back to this topic and by coincidence created the devices the other way around and the issue was gone.
    modprobe v4l2loopback devices=2 exclusive_caps=1 video_nr=12,11 card_label=py,obs

    Maybe someone can validate if it is a usefull workaround.

  18. added 2 commits that reference this issue on Jan 5, 2023
    ee341eb
    d359bed
  19. added a commit that references this issue on Jan 18, 2023
    8229d68
  20. added a commit that references this issue on Jan 29, 2023
    7b50ac9
  21. MrCybertux commented on Feb 28, 2023

    @MrCybertux

    I do not know if my Problem is related but i get the following message from the logs:

    10:11:53.177: NV12 texture support not available
    10:11:53.177: P010 texture support not available
    10:11:53.183: Failed to start virtual camera
    

    There is also strange behavior around the install from my apt repository's and the Flatpack
    After Starting the Flatpack will not show any virtual cam button.
    The Apt installed version will and up on clicking i get a promt to enter a sudoers password.
    After doing that in the apt version Flatpack suddenly shows the button for the virtual cam.
    Both do not display anything.
    Worked like a charm a few updates ago.
    The Log data:
    obslog.txt

  22. added 2 commits that reference this issue on Mar 8, 2023
    e8b14b8
    d203e93
  23. heyakyra commented on Jun 24, 2023

    @heyakyra

    SOLUTION 2 (Recommended as of today May 2022):

    You can use the terminal alone to make virtual camera and you don't need to reboot your system after making any changes
    1. Make sure you run as root@... in your terminal.
    $sudo su -
    2. (Required) To remove previously loaded v4l2loopback kernel/module. Note: You can only load v4l2loopback once so we need to unload it but not uninstall
    $rmmod v4l2loopback
    Step 3. Run v4l2loopback as root
    sudo modprobe v4l2loopback
    4. Create a new virtual camera named Your Cam Label here with custom path /dev/video69
    modprobe v4l2loopback video_nr=69 card_label="Your Cam Label here"
    5. Use ffmpeg for flushing the best video output.
    $ffmpeg -stream_loop -1 -i yourorig.mp4 -c copy tempvideofile.mp4
    If you appreciate my answer, consider donate https://www.paypal.com/paypalme/cacansoft?country.x=PH&locale.x=en_US

    Sadly this doesn't appear to work on Fedora Silverblue due to coreos/rpm-ostree#1091 (comment)

    Is there another workaround that would be compatible?

  24. added a commit that references this issue on Jul 1, 2023
    9354e98
  25. mhagnumdw commented on Sep 16, 2024

    @mhagnumdw

    For me, on Fedora 40, the virtual camera worked fine. After a system update it stopped working. After a long time trying to solve it and only seeing the message warning: Failed to start virtual camera in the OBS log without any other details, using sudo lsof | grep '/dev/video' I noticed that /dev/video0 was busy, then I discovered that stopping the v4l2-relayd service (sudo systemctl stop v4l2-relayd) made the OBS virtual camera work again!

    For now I don't know what v4l2-relayd is for or if I need it.

    My devices before and after start virtual camera:

    $ v4l2-ctl --list-devices
    Intel MIPI Camera (platform:v4l2loopback-000):
    	/dev/video0
    
  26. stephematician commented on May 20, 2025

    @stephematician
    Contributor

    For those following, here's what OBS does on Linux (in a nutshell) - I hope this helps identify workarounds:

    • On startup, OBS checks if the v4l2loopback kernel module is available.
    • Once you select Start Virtual Camera:
      • OBS checks if the module is loaded.
      • If the loopback module is not loaded, OBS will try the command modprobe v4l2loopback exclusive_caps=1 card_label='OBS Virtual Camera' (this is when it asks for your password).
        • The loopback module will create one node at /dev/video# where # is the first unused integer (starting at 0).
      • OBS searches through the files that start with /dev/video and grabs the first one that can set an output format. It searches in alpha-numerical order, e.g. /dev/video0, /dev/video1, ….

    Crucially, OBS does not check if a node was actually spawned by v4l2loopback. It can output to any V4L2 (device) with output capabilities.

    As noted in #12081, it doesn't even check that it was able to select the correct format and size - hence, I believe, what @6ffm70 sees: #3929 (comment). PR #12082 should apply better constraints on this.

    It looks like the developers intended for OBS to only use v4l2loopback devices, but maybe this isn't the best option given that there are a number of loopback-like modules available on Linux (droidcam, akvcam, etc).

    If there is scope to loosen that requirement, then I would support the user having control over which node is selected - along with a useful default (e.g. the current behaviour), along with an option to (attempt to) create a node with the v4l2loopback module if no output device is found.

    How OBS checks if the kernel module is available

    First it checks if it is loaded: It reads /proc/modules and searches for any substring match to v4l2loopback - so it can match to things like v4l2loopback_dc too - i.e. it can generate false positives.

    If not loaded, it checks if it is available: It tests for errors running modinfo v4l2loopback, which is at least more specific.

    The check on whether the module is loaded could (possibly) be replaced by looking at /dev/v4l2loopback instead, which has been available for some time.

  27. Humam-Hamdan commented on Jul 4, 2026

    @Humam-Hamdan

    When i try to start virtual camera obs goes into 0mb ram usage and i can't use the camera until after a reboot, this is the case for both the obs in my distro's repos (32.0.2 @ OpenMandirva ROME) and the flatpak version (32.1.2).

  28. stephematician commented on Jul 12, 2026

    @stephematician
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/confirmedplatform/linux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions