I used this code sample (zed-sdk/recording/playback/python/svo_playback.py at master · stereolabs/zed-sdk · GitHub) to playback svo files and get both frames and fps, but I wonder how can I get timestamps, just as the fuction in opencv: get(cv2.CAP_PROP_POS_MSEC)
Hi @oopsyrah, welcome to the forums!
You can use the get_timestamp function like this in your retrieve_image loop:
cam.retrieve_image(mat)
cv2.imshow("ZED", mat.get_data())
timestamp = cam.get_timestamp(sl.TIME_REFERENCE.IMAGE)
print(timestamp.get_milliseconds())
key = cv2.waitKey(1)
saving_image(key, mat)
Best regards,
Jean-Loup