Start a new topic

wikitude record video and screenshot

Hi we need to make sreenshot and record video from out app, we want use https://assetstore.unity.com/packages/tools/integration/natcorder-video-recording-api-102645 but in description we dont see wikitude support


Quote: "AR Support. NatCorder has full support for ARFoundation, ARCore, ARKit, and Vuforia."


I want create screenshot of my AR object and camera


when i try do it i have problems. My AR camera draw in depth only mode, so my image like this

image


this image dont have image from camera

So. How i can make screenshot and record video?



Hi,


Does this forum post help:

https://support.wikitude.com/support/discussions/topics/5000091657


Thx and greetings


Nicola


1 person likes this

Hi wikitude team. I use NatCorder plugin, and i need to record video with AR object and real world(background)

For this i have AR camera which draw AR model in depth camera mode, also i create one more camera to draw real world at plane.This is my AR camera http://prntscr.com/tj6s3z

This is camera which draw real world -> http://prntscr.com/tj6rn0

and when i record video, i use both camera. 


[code=CSharp] 

_clock = new RealtimeClock();

_videoRecorder = new MP4Recorder(

            1080,

            1920,

            30,

            AudioSettings.outputSampleRate,

            2

        );

_cameraInput = new CameraInput(_videoRecorder,_clock,Camera.allCameras);

_audioInput = new AudioInput(_videoRecorder,_clock,Camera.main.GetComponent<AudioListener>());

[/code]


my video at android(perfect)  -> https://youtu.be/UXoVQEQExzY 

my video at ios(problems, the video seems to be cropped) -> https://youtu.be/dZg-jjwa88E

How to fix it, please help

i also asking in natcorder unity support forum, maybe you will interested -> https://forum.unity.com/threads/natcorder-video-recording-api.505146/page-63#post-6098496

i use latest natcorder, unity 2019.3.15 and wkitude 9.2

UPD: 

Answer from NatCorder support


You'll have to reach out to Wikitude's support for this one. CameraInput is simply rendering the camera view to a texture. It is likely the case that Wikitude is overriding how the camera renders, which is why it is offset (cropped). This would have nothing to do with NatCorder, and you can verify this by looking at the CameraInput sources; all it is doing is re-rendering the camera to a RenderTexture by calling `camera.Render`. The camera is expected to render normally, as it did when rendering to the screen.

Hi Maksim,
if you are using Professional Edition, the Background Camera is hidden. With this simple script you can enable it and add to NatCorder.


 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BackgroundCameraEnable : MonoBehaviour
{
    public Camera BackgroundCamera;

    void Update() {
        if(!BackgroundCamera) {
            BackgroundCamera = gameObject.transform.Find("BackgroundCamera").GetComponent<Camera>();
            BackgroundCamera.gameObject.hideFlags = HideFlags.None;
        }
    }
}

 


Kind regards,
Gökhan

thanks, I'll check it out. But why is this information not in the documents? or is it my fault?

Hi Gökhan

This is doesnt work for me or I doing something wrong?!

BackgroundCamera dont draw real world, but seems like in video background is in. but video is incorrect and very laggy. video attached 



image


mp4

Hi Maksim,

is this video recorded in the Unity Editor? Does this also happen on the device?

That looks like the Unity Editor running in the background.


Could you send a demo project where I could have a closer look?


Kind regards,

Gökhan

Hi Maksim,
I just saw that we probably don't support this functionality yet. A fix is coming with the next release in a month.
I can send you a custom build, where the background camera isn't hidden at runtime and different resolutions with NatCorder are supported, if you want. Just let me know.

Kind regards,
Gökhan

Thanks, will test it in future.

Also i want to ask. Is it possible to change image recognition for tracking picture in dark colors.

you see at this video. light image fine, darker - no

https://www.youtube.com/watch?v=cAGmrhXe5KQ&feature=youtu.be

That should track perfectly. Could you send me the target collection for me to investigate?

Kind regards,
Gökhan

https://drive.google.com/file/d/1mvPa8jH-fhgj40afIoq3oEEh4hOupWwP/view?usp=sharing

main problem appear when you print image and coloring. If you will hover a camera to screen everything will be ok

That's an interesting use case. Let me quickly check with our CV team what best to use as an image target. Meanwhile, you could try to make a transparent image target out of a .png, with just the black lines and a transparent background, in a .zip format. Additionally, let's proceed in another thread regarding this issue please.

Kind regards,
Gökhan

we cant use zip because we MUST have only 1 dataset

Login or Signup to post a comment