Playback of SVO recording with external data

Dear StereoLabs support,

I followed the examples for recording and playback SVO files with external data using the Python API.

Recording works well and for each frame I write some data with sl.TIME_REFERENCE.IMAGE timestamp, however when I play back frames I get out of sync data.
For the first frame in the video, retrieve_svo_data fails, then from the second frame on, retrieve_svo_data works, but I don’t get the data I was expecting:

  • Frame 0: failure
  • Frame 1: success, but got data of frame 0
  • Frame 2: success, but got data of frame 1

The API reference of retrieve_svo_data is not clear on how the timestamp range is treated, in particular if it is considered an open or closed interval. Playing with the timestamps I realised that in order to get the expected data (i.e. data 0 for frame 0, data 1 for frame 1, etc.) I had to add 1 nanosecond to both ts_begin and ts_end.

This workaround of adding 1 ns got me where I wanted, but it doesn’t look very clean.
Retrieving the data that was saved for a frame looks like a major use case of this API, so I was wandering if got it wrong and there is a better way to accomplish this task.

I’m on Orin NX with Jetpack 6.2.1 and ZED SDK 5.4.1.

Thanks in advance,
Massimo