arunityx icon indicating copy to clipboard operation
arunityx copied to clipboard

Please add support for "WebCamTexture" in unity

Open StartNight opened this issue 1 year ago • 7 comments

Please support "WebCamTexture" in unity. This allows more platforms to be supported. I've been looking into using ARtoolkitx to bring AR effects to more platforms. However, some platforms support a native API to capture the camera footage. While it's great to support Windows, Android, iOS in the ARtoolkitx source code, there are some platforms that don't support it. Use unity's 'WebCamTexture' to support many more platforms from the unity native code level. Please add this feature. Thanks!

StartNight avatar May 10 '23 12:05 StartNight

Support for external textures including WebcamTexture is planned.

philip-lamb avatar May 15 '23 06:05 philip-lamb

Thank you very much!

StartNight avatar May 15 '23 08:05 StartNight

First part is in #76

philip-lamb avatar Jun 05 '23 10:06 philip-lamb

Is Unity Webcamtexture support finished? I am using Unity on Mac, but instead of apple’s AVFoundation I prefer using unity webcamtexure.

After digging around the source code, I am able to find code related to “unity video source” here and there. It seems like all the functions needed are there but I could not make it work.

I tried things below but got no luck. — Manually override the config to “module=External -nocopy” — Call arwVideoPushInit manually.

If Webcamtexture support is finished can you provide documentation or guidance for proper way to set it up?

BTW, really appreciated your detailed work. Thank you in advance.

vizluk avatar Feb 19 '24 02:02 vizluk

It's not complete yet, although most of the underlying pieces needed for it are. I'll do a quick review and see what's needed.

philip-lamb avatar Feb 20 '24 18:02 philip-lamb

You are awesome!

vizluk avatar Feb 21 '24 02:02 vizluk

While waiting for your update I read through previous documentation and got a basic understanding of how the start sequence might work.

So I disabled Auto-start AR, and executed following code trying to establish external video source.

ARXController.Instance.PluginFunctions.arwStartRunningB("-module=External -nocopy",null,0); ARXController.Instance.PluginFunctions.arwVideoPushInit(0,1920,1080,"RGBA",0,0)

However, every time I run till the second line arwVideoPushInit the Unity crashes with no error message. I was on M1 Mac using Unity 2023, then tried intel Mac with Unity 2021 LTS, still got the same issue.

Am I doing the external video setup wrong? Can you give me a simple guidance on steps to set it up?

vizluk avatar Mar 25 '24 15:03 vizluk