Try MAXST AR Fusion Tracker Now ✨
List
Screen/AR Recorder?
Posted Date: 2020-09-25 3:12     Edited Date: 2020-10-05 6:24     Writer: osaro212

1. SDK Version: 5.0.2
2. Development Environment: Unity 2019.3.6, Unity-Android, Unity-iOS
3. Tracker/Scanner: ImageTracker
4. License Type: Free
5. Target Device(Optional):Android Galaxy S8

1. I've tested with Natcorder/Natdevice to record the screen and its works but I've run into an issue where the augmented videoclip freezes for a second or two upon pressing the record button. It has also happened in the middle of recording. Any ideas what could be causing this?  Is there a sample example available to record the augmentation and background or recommendations for alternatives to recording?

 

2. Unrelated, I've come across several errors when building, I don't think my builds have been affected since I'm using Image tracking.

Posted Date: 2020-09-28 8:37     Edited Date: 2020-09-28 8:38     Writer: sjkim

Thanks for your interest to our MAXST AR SDK.


Your problem It seems that an error occurs due to a collision between AR Camera and Natcorder/Natdevice camera .

 

But, You can solve with maxstAR.CameraDevice.SetNewFrame() function of MAXST Unity API.

SetNewFrame() is to manually enter the buffer when an external camera that cannot be captured by the camera is connected and

the buffer for the external camera cannot be received.

(SetNewFrame() function only use Free and Enterprise license)

 

Finally, We don't official support record the screen app.

Unfortunatly We don't recommend recording app.

 

If you have other questions, feel free to ask us.

 

 

Best regards,

Francisco

MAXST Support Team

Posted Date: 2020-09-28 21:56     Edited Date: 2020-09-28 22:03     Writer: osaro212

Can you provide a more detailed way to implement SetNewFrame() with ImageTracking to fix the recording issue?

I found the code below in the videotrackersample.cs and I copied it over to the imagetrackersample.cs but it didnt work. Is this the correct code? is there additional code? What changes should be made? I checked the documentation and the forum and couldnt find the right solutions. Please advise, I would like to get this working

private Texture2D texture2D = null;

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);
}

Posted Date: 2020-10-05 6:24     Edited Date: 2020-10-05 6:24     Writer: sjkim

Sorry to late rely.

Last week, we during Chuseok holiday(Korean Thanks giving Day).

 

SetNewFrame() function necessary to set external camera(Natcorder/Natdevice camera) image to AR engine.

Therefore, you add to SetNewFrame() function and StartCamera() function in Natcorder/Natdevice source.

 

Please refer to the bottom Example code.

---

OnNewFrame();

 

if (Application.platform == RuntimePlatform.Android)
{
    StartCamera();
}

else if(Application.platform == RuntimePlatform.IPhonePlayer)
{
    StartCamera();
}

else
{
    StopCamera();
}

 

void OnNewFrame(CameraDevice source, long frameIdx)
{

...

}

---

 

If you have other questions, feel free to ask us.

 

 

Best regards,

Francisco

MAXST Support Team