virtualcam can't show up

lxlenovostar

New Member
I build obs 26.1.1 from source codes. I get the codes form github. I try to debug it, and I find RegOpenKeyExW return 2.

C:
#ifdef VIRTUALCAM_ENABLED
extern "C" struct obs_output_info virtualcam_info;

static bool vcam_installed(bool b64)
{
    wchar_t cls_str[CHARS_IN_GUID];
    wchar_t temp[MAX_PATH];
    HKEY key = nullptr;

    StringFromGUID2(CLSID_OBS_VirtualVideo, cls_str, CHARS_IN_GUID);
    StringCbPrintf(temp, sizeof(temp), L"CLSID\\%s", cls_str);

    DWORD flags = KEY_READ;
    flags |= b64 ? KEY_WOW64_64KEY : KEY_WOW64_32KEY;

    LSTATUS status = RegOpenKeyExW(HKEY_CLASSES_ROOT, temp, 0, flags, &key);
    if (status != ERROR_SUCCESS) {
        return false;
    }

    RegCloseKey(key);
    return true;
}
#endif

I know we should update registry of Windows10, mybe it's wrong.
How to fix it? I don't know much about Windows10.
Thank you
 

lxlenovostar

New Member
I read virtualcam-install, why we need 32DLL and 64DLL?

Bash:
@echo off
@cd /d "%~dp0"
goto checkAdmin

:checkAdmin
    net session >nul 2>&1
    if %errorLevel% == 0 (
        echo.
    ) else (
        echo Administrative rights are required, please re-run this script as Administrator.
        goto end
    )

:checkDLL
    echo Checking for 32-bit Virtual Cam registration...
    reg query "HKLM\SOFTWARE\Classes\WOW6432Node\CLSID\{A3FCE0F5-3493-419F-958A-ABA1250EC20B}" >nul 2>&1
    if %errorLevel% == 0 (
        echo 32-bit Virtual Cam found, skipping install...
        echo.
    ) else (
        echo 32-bit Virtual Cam not found, installing...
        goto install32DLL
    )

:CheckDLLContinue
    echo Checking for 64-bit Virtual Cam registration...
    reg query "HKLM\SOFTWARE\Classes\CLSID\{A3FCE0F5-3493-419F-958A-ABA1250EC20B}" >nul 2>&1
    if %errorLevel% == 0 (
        echo 64-bit Virtual Cam found, skipping install...
        echo.
    ) else (
        echo 64-bit Virtual Cam not found, installing...
        goto install64DLL
    )
    goto endSuccess

:install32DLL
    echo Installing 32-bit Virtual Cam...
    if exist "%~dp0\data\obs-plugins\win-dshow\obs-virtualcam-module32.dll" (
        regsvr32.exe /i /s "%~dp0\data\obs-plugins\win-dshow\obs-virtualcam-module32.dll"
    ) else (
        regsvr32.exe /i /s obs-virtualcam-module32.dll
    )
    reg query "HKLM\SOFTWARE\Classes\WOW6432Node\CLSID\{A3FCE0F5-3493-419F-958A-ABA1250EC20B}" >nul 2>&1
    if %errorLevel% == 0 (
        echo 32-bit Virtual Cam successfully installed
        echo.
    ) else (
        echo 32-bit Virtual Cam installation failed
        echo.
        goto end
    )
    goto checkDLLContinue

:install64DLL
    echo Installing 64-bit Virtual Cam...
    if exist "%~dp0\data\obs-plugins\win-dshow\obs-virtualcam-module64.dll" (
        regsvr32.exe /i /s "%~dp0\data\obs-plugins\win-dshow\obs-virtualcam-module64.dll"
    ) else (
        regsvr32.exe /i /s obs-virtualcam-module64.dll
    )
    reg query "HKLM\SOFTWARE\Classes\CLSID\{A3FCE0F5-3493-419F-958A-ABA1250EC20B}" >nul 2>&1
    if %errorLevel% == 0 (
        echo 64-bit Virtual Cam successfully installed
        echo.
        goto endSuccess
    ) else (
        echo 64-bit Virtual Cam installation failed
        echo.
        goto end
    )

:endSuccess
    echo Virtual Cam installed!
    echo.

:end
    pause
    exit
 

lxlenovostar

New Member
I fix it by this steps:

  1. I comilpe 32 bits of obs and get the obs-virtualcam-module32.dll.
  2. copy the obs-virtualcam-module32.dll to the 64bits directory, for example: C:\Users\lxlen\obs\debug\rundir\Debug\data\obs-plugins\win-dshow

In short, we need 32 bits and 64 bits DLL in the same time.
 

Vannes Yang

New Member
Thank you for information.
I tried in funciton
Code:
bool obs_module_load(void)
of dshow-plugin.cpp, I wrote:
Code:
    bool installed = vcam_installed(true); // vannes: default is false and will find 32-bit vcam dll, but we build 64bit only
And I only do regsvr32 with 64bit obs-virtualcam-module64.dll in virtualcam-install, that's working!
 

Vannes Yang

New Member
By the way,
I think there should be comment for it on OBS build instruction website. It's hard work for newbie.
 
Top