Holistic Record and Replay
DEPTHAI_REPLAY environment variable to the path of the recording.Holistic record and replay works by recording the calibration, camera features information, and data (messages) of source nodes used in an application (Camera and IMU) which can then be replayed as if the source nodes sent the same data again.Holistic Record
tar file. This can be enabled in code:Python
Python
1with dai.Pipeline as pipeline:
2 config = dai.RecordConfig()
3 config.outputDir = "./recordings";
4 config.videoEncoding.enabled = True # Use video encoding
5 config.videoEncoding.profile = dai.VideoEncoderProperties.Profile.H264_MAIN
6
7 pipeline.enableHolisticRecord(config)DEPTHAI_RECORD environment variable:Command Line
1DEPTHAI_RECORD="./recordings" python3 application.pyEnvironment variable configuration
DEPTHAI_RECORD environment variable is set to the recording output directory. This enabled holistic recording with the default configuration options. If you want more control you set the variable to the path to a configuration file:JSON
1{
2 "outputDir": "recordings/",
3 "compressionLevel": 3,
4 "syncCameraOutputs": true,
5 "videoEncoding": {
6 "enabled": true,
7 "bitrate": 0,
8 "lossless": false,
9 "profile": "MJPEG",
10 "quality": 80
11 }
12}outputDirsets the output directory of the recordingcompressionLevelconfigures the compression of the metadata. It ranges from 0 to 5 (inclusive) which corresponds to the following compression levels:NONE,FASTEST,FAST,DEFAULT,SLOW,SLOWESTsyncCameraOutputsenables camera output synchronization. This prevents dropped messages from causing issues when replaying into StereoDepth or similar nodes that require synchronized frames.videoEncodingconfigures the VideoEncoder that encodes the camera stream:enabledenables the VideoEncoder. Whenfalse, the output of the Camera node is recorded which can decrease the device CPU usage while increasing bandwidth usageprofilesets the encoding profilebitratesets the VideoEncoder bitrate (when set to 0 it is determined automatically)losslessdetermines whether the encoding should be lossles where applicablequalitydetermines the encoding quality where applicable
Example of functionality
Holistic Replay
Python
Python
1with dai.Pipeline as pipeline:
2 pipeline.enableHolisticReplay("./recordings/recording.tar")DEPTHAI_REPLAY environment variable:Command Line
1DEPTHAI_REPLAY="./recordings/recording.tar" python3 application.pyExample of functionality
Limitations
- As replaying requires sending messages from the host to the device, using this functionality significantly reduces the fps of the pipeline.
- The frame timestamps can drift on each loop when replaying, as the loop timestamp offsets are calculated independently for each camera stream. This can cause issues with message synchronization after some time.
- At this point in time, only single device pipelines can be holistically recorded and replayed.