Record EIF files and use them for simulated runtime
EIF file (EasyAR Input Frame file) is the file format used by EasyAR Sense to store a sequence of input frame data. This article mainly describes how to record EIF files and use them for simulated runtime.
EIF files and contents
EIF files have two implementations depending on the recording method:
Original EIF format (usually with the .eif extension)
Original EIF files store input frame data frame by frame using data structures defined inside EasyAR, including images and additional information such as camera parameters and tracking status. This format does not use video compression. Instead, it encodes data frame by frame, such as JPEG image data, which makes it suitable for accurate playback.
EIF MKV format (usually with the .mkveif extension)
This is a video format based on an MKV container. Input frame information is encoded into the MKV container on this basis. Video encoding uses H.264 to compress image data, while other input frame metadata, such as IMU sensor data and localization data, is retained as streams or additional tracks. This can significantly reduce file size and makes standard video stream processing easier.
Note
The EIF MKV format currently only supports recording on Android/iOS/macOS/visionOS and playback on Windows/macOS. The traditional EIF format does not have this limitation.
EIF recording and playback
EasyAR provides a complete mechanism for recording and playback, mainly controlled through the following components:
InputFrameRecorder / InputFramePlayer
Purpose
Recording and playback components for the original EIF format.
Features
During recording, all incoming input frames are serialized and saved, including images, parameters, tracking status, and other data.
VideoInputFrameRecorder / VideoInputFramePlayer
Purpose
Recording and playback components for the EIF MKV format.
Features
Recording supports more sensor data streams, such as gyroscope, accelerometer, and localization data, and packages them into an EIF MKV file together. The playback side can choose to output this data, making it convenient to fully simulate the various inputs at recording time on a PC.
Principles and achievable effects of using EIF for simulated runtime
Using a recorded EIF file as the input data source is equivalent to "replaying" the complete data stream of the physical camera and related sensors to the AR engine at runtime. By simulating the input frame sequence:
The AR engine considers that it is still obtaining data from the physical camera
Each frame output during playback contains the original timestamp, camera parameters, and tracking status, driving the algorithm to process these frames as if it were running on real-time data.
Real runtime behavior can be reproduced in non-device environments, such as a PC or the Unity Editor
In this way, you can debug visual tracking, spatial maps, and other features without a physical device, and simulate Mega and other features on Windows/Mac.
Using EIF for simulated runtime can achieve the following effects:
Reproduce the real data flow Even without a camera, AR features can be driven as if they were running in a real environment, such as planar image tracking, spatial localization, and dense map generation.
Make development, debugging, and diagnostics easier Recorded EIF files can be used to analyze causes of tracking failure, verify AR algorithm behavior on specific inputs, or inspect performance fluctuations.
Cross-platform playback EIF files can be transferred between different platforms to reproduce AR Session behavior recorded on a phone on a PC, enabling debugging without the device.
Next steps
Platform-specific guides
Recording EIF files and using them for simulated runtime is closely related to the platform. Refer to the following guides for development according to your target platform: