getSVOPositionAtTimestamp() doesn't work as expected

I have an SVO2 file.

First of all, I check initial and final timestamps.

auto n = zed.getSVONumberOfFrames();
zed.grab(runParameters);
auto ts0 = zed.getTimestamp(sl::TIME_REFERENCE::IMAGE);
zed.setSVOPosition(n-2);
zed.grab(runParameters);
auto ts1 = zed.getTimestamp(sl::TIME_REFERENCE::IMAGE);
RCLCPP_INFO(get_logger(), "SVO file starts at %f and ends at %f [duration: %f]", slTime2Ros(ts0).seconds(), slTime2Ros(ts1).seconds(), slTime2Ros(ts1).seconds()- slTime2Ros(ts0).seconds());
zed.setSVOPosition(0);

I get:

SVO file starts at 1741616106.944607 and ends at 1741616375.278633 [duration: 268.334026]

Then, I do:

int ret = zed.getSVOPositionAtTimestamp(1741616118701639000); 

so I ask to seek a frame at a timestamp in between initial and final timestamp.

However, the index I get as result is the last frame of the SVO, not something that falls in the middle. This is not expected.

How can I solve this problem?

Moreover, I would propose the API getSVOTimestampAtPosition(int pos) for easy access to timestamps inside the SVO.

I did an additional test, looping through some timestamps (15 Hz):

SVO file starts at 1741616106.944607019 and ends at 1741616375.278632879 [duration: 268.334025860]
SVO position restored to 0
Query: 1741616106.944607019 	 Index: 0
Query: 1741616107.011273623 	 Index: 4035
Query: 1741616107.077940226 	 Index: 4035
Query: 1741616107.144607067 	 Index: 4035
Query: 1741616107.211273670 	 Index: 4035
Query: 1741616107.277940273 	 Index: 4035
Query: 1741616107.344606876 	 Index: 4035
Query: 1741616107.411273718 	 Index: 4035
Query: 1741616107.477940321 	 Index: 4035
Query: 1741616107.544606924 	 Index: 4035
Query: 1741616107.611273766 	 Index: 4035
Query: 1741616107.677940130 	 Index: 4035
Query: 1741616107.744606972 	 Index: 4035
Query: 1741616107.811273813 	 Index: 4035
Query: 1741616107.877940178 	 Index: 4035
Query: 1741616107.944607019 	 Index: 4035
Query: 1741616108.011273623 	 Index: 4035
Query: 1741616108.077940226 	 Index: 4035
Query: 1741616108.144607067 	 Index: 4035
Query: 1741616108.211273670 	 Index: 4035
Query: 1741616108.277940273 	 Index: 4035
...

so it seems every timestamp after the first is marked as the last frame by the getSVOPositionAt Timestamp

Hi @roncapat
thank you for reporting this problem. Ith as been logged and it will be solved with one of the next SDK releases.