Holistic Record and Replay
To simplify development and later testing and debugging of your application, you can record and replay test data. This can be done without any changes to your code with the use of environmental variables and configuration files.Holistic record and replay works by recording 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
Holistic record records enabled source node streams to atar
file. This can be enabled in code:Python
C++
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.py
Environment variable configuration
In the above example, theDEPTHAI_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 "compressionLevel": 3,
3 "outputDir": "recordings/",
4 "videoEncoding": {
5 "enabled": true,
6 "bitrate": 0,
7 "lossless": false,
8 "profile": "MJPEG",
9 "quality": 80
10 }
11}
compressionLevel
configures the compression of the metadata. It ranges from 0 to 5 (inclusive) which corresponds to the following compression levels:NONE
,FASTEST
,FAST
,DEFAULT
,SLOW
,SLOWEST
outputDir
sets the output directory of the recordingvideoEncoding
configures the VideoEncoder that encodes the camera stream:enabled
enables the VideoEncoder. Whenfalse
, the output of the Camera node is recorded which can decrease the device CPU usage while increasing bandwidth usageprofile
sets the encoding profilebitrate
sets the VideoEncoder bitrate (when set to 0 it is determined automatically)lossless
determines whether the encoding should be lossles where applicablequality
determines the encoding quality where applicable
Example of functionality
Holistic Replay
Holistic replay replays recorded source streams. Similarly to holistic record it can be enabled in code:Python
C++
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.py
Example of functionality
Limitations
This functionality is a work in progress and comes with some limitations:- As it currently only records source node streams, replaying on a different device can produce unexpected results (e.g. as camera extrinsics are not recorded,
StereoDepth
can produce incorrect results if the calibration differs between the recording and replaying cameras) - At this point in time, only single device pipelines can be holistically recorded and replayed.