FrameRecording

Demonstrate how to record and use eif file.

  • Demonstrate how to record eif file

  • Demonstrate how to playback eif file and use it for diagnosing

How to Use

../../_images/image_21.png
Recorder: Switch to frame recorder mode.
Player: Switch to frame playback mode.
Record/Playback/Stop: Start/Stop record or playback.

How It Works

Frame recorder in the scene

You need to add a FrameRecorder in the scene to record frame. You can reference API documents for detailed settings.

../../_images/image_s21_1.png

You can set file path to save the recoreded eif file in the inspector or in the script. This sample set the path in the script.

Configure ARSession to use FrameRecorder

This sample make such configuration in the script. It should be done before ARSession.Start is called.

var picker = easyarObject.GetComponentInChildren<ARComponentPicker>();
picker.FrameRecorder = ARComponentPicker.SingleSelection.FirstAvailableActiveChild;

recorder = easyarObject.GetComponentInChildren<FrameRecorder>();
recorder.FilePathType = WritablePathType.Absolute;
recorder.FilePath = filePath;

In your own project, you can also configure ARSession to use FrameRecorder in the scene dirctly.

../../_images/image_s21_3.png

Start/Stop FrameRecorder

FrameRecorder can be turned on or off using FrameRecorder.enabled.

recorder.enabled = val;

Frame player in the scene

You need to add a FramePlayer in the scene to playback frame. You can reference API documents for detailed settings.

../../_images/image_s21_2.png

You can set eif file path for playback in the inspector or in the script. This sample set the path in the script.

Configure ARSession to use FramePlayer

This sample make such configuration in the script. It should be done before ARSession.Start is called.

var picker = easyarObject.GetComponentInChildren<ARComponentPicker>();
picker.FramePlayer = ARComponentPicker.SingleSelection.FirstAvailableActiveChild;

player = easyarObject.GetComponentInChildren<FramePlayer>();
player.FilePathType = WritablePathType.Absolute;
player.FilePath = filePath;

In your own project, you can also configure ARSession to use FramePlayer in the scene dirctly.

../../_images/image_s21_4.png

Start/Stop FramePlayer

FramePlayer can be turned on or off using FramePlayer.Play or FramePlayer.Stop.

if (val)
{
    player.Play();
}
else
{
    player.Stop();
}

FramePlayer is one type of FrameSource. Other FrameSources will not be used when FramePlayer is in use.

The usage of eif file

The eif file generated by FrameRecorder can be used for device diagnose. When you record a eif file on the device, frames including images, camera parameters, tracking status will be stored. This file can be used on PCs to run motion tracking simulation and can drive sparse spatial map and dense spatial map to work on Windows or Mac.

In this sample, you can record eif on Android or iOS device and playback on Windows or Mac, with some modifications for file path.

If you want to record and use eif for motion tracking or spatial map, you need to use frame sources that are capable of motion tracking in the scene when recording.

Eif file recorded is not a full copy of runtime data, recording frame rate may drop on some low end devices.