Log in or register to post comments

Custom Camera Driver in Unity Player (Windows)

April 4, 2021 - 11:43pm #1

Hi,

I'm downloaded the custom driver template for the latest Vuforia SDK and have built the DLL successfully. I then copy it to a simple project I have that works in Unity Player with my webcam. I've placed the dll in Assets/Plugins/WSA. I then attach a script to ARCamera that does the following:

public class InitCustomDriver : MonoBehaviour

{

  private void Awake()

  {

    VuforiaUnity.SetDriverLibrary("DriverTemplate.dll");

    VuforiaRuntime.Instance.InitVuforia();

  }

}

Running this in the editor shows an error message indicating that Vuforia failed to initialize. Attached is a photo of the DLL settings.

I've also tried building a UWP .exe but these fail to even launch with all sorts of missing MSVC runtimes, which is odd. Is it possible to run these custom driver DLLs from the player and if so, how?

EDIT: By checking "Load on startup", I think the driver is being loaded (I test this by having it write a file to disk). However, Unity is still pulling frames from my web cam whereas the driver template sample should be showing a static frame that is hard-coded in the source code.

Thank you,

Bart

 

 

 

AttachmentSize
Image icon dll_1.png63.05 KB
Image icon dll_2.png69.88 KB

Custom Camera Driver in Unity Player (Windows)

April 13, 2021 - 4:59am #2

Hi,

I am not quite sure what you want to achieve. Usually to use webcameras with Unity/Vuforia are plug and play. Once the webcamera is recognized by the OS, Unity and VE should pick it up.

If you want to experiment with the External camera we have this sample for exploring: https://library.vuforia.com/articles/Solution/uvc-camera-driver.html

Thank you.

Vuforia Engine Support

 

Log in or register to post comments