How to Create Datasets for Playback


With NSDK's Recording feature, you can record the real-world location of your AR application for playback and testing in the Unity editor. You can create a playback dataset by using the Recording sample project or by recording through the API.
Recording data
Recording formats
NSDK can produce two versions of a scan recording:
- Raw Scan format: By default, AR Scanning Manager will write frames directly to disk.
- This is the format that Scan Reconstruction accepts.
- The files are saved to the directory at
ScanStore.SavedScan.ScanPath. Metadata is stored in .pb files.
- Playback format: Optionally, the recorded frames can be exported to a compressed .tgz archive.
- This is the format that Playback and VPS accept.
- The sequence is archived to
ScanStore.SavedScan.ScanBasePathin a .tgz. Metadata is stored in a capture.json file.
This walkthrough demonstrates how to produce the second format for use with Playback.
File locations
By default, scan recordings will be saved to these paths. Setting AR Scanning Manager's Scan Path field to a custom location will override this. In Unity apps, the saved location is available in the ScanStore.SavedScan.ScanBasePath property[ScanStore.SavedScan.ScanBasePath.
| Platform | Unity SDK | Native SDK |
|---|---|---|
| iOS | {App Files}/scankit/ | {App Files}/scankit/ |
| Android | /sdcard/Android/data/{app.package.name}/files/scankit/ | /sdcard/Android/data/{app.package.name}/files/scankit/ |
| macOS | /Users/{Username}/Library/Application Support/{CompanyName}/{ApplicationName}/scankit/ | {Application path}/data/scankit/ |
| Windows | C:\Users\{Username}\AppData\LocalLow\{CompanyName}\{ApplicationName}\scankit\ | C:\Users\{Username}\AppData\Local\ardk_data\scankit\ |
To retrieve the files from an iOS app in Finder, add UIFileSharingEnabled and LSSupportsOpeningDocumentsInPlace to the app's info.plist. To retrieve the files from an Android app, use adb pull with the appropriate path.
Using the Scanning Sample to Record
Prerequisites
To scan using the Recording sample project, you will need to download it and build it to your device. For more information, see the Recording sample project.
Steps
To record a playback dataset using the sample:
- Open the recording sample on your device. If running on iOS, connect to the internet. When you are ready to record the dataset, tap Start.
- Wait for the recording to begin. When scanning with Unity on iOS, there is a brief delay the first time that scanning starts while the SDK downloads a model file to convert Unity's MSL altitude values to WGS84.
- Record the environment using your device's camera. Keep in mind the following:
- Keep your device in Portrait Mode.
- Hold your device as steadily as possible to reduce errors in the dataset.
- The sample saves dataset recordings every minute. If you continue recording after one minute, the app will start a new recording. (For example, if you record for 3.5 minutes, the sample creates four separate datasets.)
- Tap Stop to finish recording. At this point, you have a recording in Raw Scan format.
- When you are ready, tap Export to convert your most recent Raw Scan recording to a Playback format dataset.
- After the export is complete, the sample will display a path to the archived dataset. Remember this path and proceed to Accessing Your Recorded Data on the Device.

For Unity iOS builds, NSDK is configured to convert the MSL altitude provided by Unity to WGS84. This conversion requires a one-time download. The first time that scanning runs on iOS, the device must have an active internet connection and will experience a brief delay while the 20 MB model file downloads.
Using the API to Record Datasets
If the Recording sample is too limited for your project, you can create your own recording app instead.