Can I use custom input instead of using camera? Example : A Quad having a video player component and camera fixed on to the quad.
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.
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
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.
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.
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
You can see Camera Stop Function in ARBeheviour.cs.
thank you.
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.
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.
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?
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.
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?