List
Can I use custom input instead of using camera? Example : A Quad having a video player component and camera fixed on to the quad.
Posted Date: 2019-01-28 12:34     Edited Date: 2019-02-25 9:27     Writer: inactive

Hello,

I want to use Unity camera gameobject's view as a feed to Maxst to process frames for markers. Instead of using mobile camera or webcam, can I place a video on a quad object and use a camera gameobject with its view as the quad and use Maxst SDK to process AR objects? If yes, can you please help me with any resources for the same.

1. SDK Version: 4.0.4
2. Development Environment: Unity-Android
4. License Type: Free
5. Target Device: Windows

Thanks in advance.

Posted Date: 2019-01-29 1:27     Edited Date: 2019-01-29 1:27     Writer: slkim

are you want to make partial frame for AR?
i need more information. 


1. if you want to use third party camera.(ex. mp4, image sequence) use 'SetNewFrame' function, but this is Enterprise License.
2. Refer to this for partial frame AR.
https://github.com/maxstdev/MaxstARSDK_Unity_RenderToTexture

Posted Date: 2019-01-29 7:35     Edited Date: 2019-01-29 7:35     Writer: inactive

I want to use third party camera - image sequence. Can I use SetNewFrame function in any script? When I use the function, will it stop using the camera?

Thanks.

Posted Date: 2019-01-29 7:57     Edited Date: 2019-01-29 7:57     Writer: slkim

function 'SetNewFrame' exist at CameraDevice.cs. you can use that function any script.

and if you use 'SetNewFrame', must be stop Camera Input for AR. because Image Sequence and Camera Input is can't use together.

Posted Date: 2019-01-29 9:04     Edited Date: 2019-01-29 9:04     Writer: inactive

Thanks for the reply.

How do I turn off the camera Input for AR because I could see that when I launch the app, the camera is getting turned on. Is there any way to disable it?

Thanks

Posted Date: 2019-01-30 1:39     Edited Date: 2019-01-30 1:39     Writer: slkim

You can see Camera Stop Function in ARBeheviour.cs.

thank you.

Posted Date: 2019-02-19 10:17     Edited Date: 2019-02-19 10:17     Writer: inactive

The app keeps crashing when I use this code

maxstAR.CameraDevice cdx;

cdx = maxstAR.CameraDevice.GetInstance();

cdx.SetNewFrame(frameData, width_ * height_ * 3, width_, height_, maxstAR.ColorFormat.RGB888);

Edit: Can someone explain how can I use the CameraDevice to set a frame? Do I have to change any other scripts to make it work

Edit 2: I have ver

TIA.

Posted Date: 2019-02-20 1:06     Edited Date: 2019-02-20 1:06     Writer: slkim

SetNewFrame is available in an enterprise license.
We will update new version 4.1.1. then Fucntion will be available in the Free License.

 

Keane.

Maxst Support Team.

Posted Date: 2019-02-21 5:19     Edited Date: 2019-02-21 5:19     Writer: inactive

I have the enterprise license. The app keeps crashing when I use the SetNewFrame() function.

My code:

maxstAR.CameraDevice cdx;

cdx = maxstAR.CameraDevice.GetInstance();

cdx.SetNewFrame(frameData, width_ * height_ * 3, width_, height_, maxstAR.ColorFormat.RGB888);

Are there any sample codes for custom input?

Posted Date: 2019-02-21 7:01     Edited Date: 2019-02-21 7:01     Writer: slkim

void OnNewFrame(VideoPlayer source, long frameIdx)

{

RenderTexture renderTexture = source.texture as RenderTexture;

 

if (texture2D == null) {

texture2D = new Texture2D(renderTexture.width, renderTexture.height, TextureFormat.RGBA32, false);

}

 

RenderTexture.active = renderTexture;

texture2D.ReadPixels(new Rect(0, 0, renderTexture.width, renderTexture.height), 0, 0);

texture2D.Apply();

RenderTexture.active = null;

CameraDevice.GetInstance().SetNewFrame(texture2D.GetRawTextureData(), texture2D.GetRawTextureData().Length, texture2D.width, texture2D.height, ColorFormat.RGBA8888);

}

This is sample code. how to use SetNewFreme.

 

Keane.

Maxst Support Team.

Posted Date: 2019-02-25 9:27     Edited Date: 2019-02-25 9:27     Writer: inactive

When I tried to run the app from unity play mode, it runs for sometime and then it crashes. This happens when I use the SetNewFrame() function. I tried using -force-opengl and -force-d3d11 but nothing seem to work. My question is why is the app crashing after running fine for some time?