Timestamps in data #1885
Replies: 3 comments 6 replies
-
Hi @roaldarbol, SLEAP does not keep the timestamps. If the video you loaded in SLEAP has one of these extensions: Line 354 in 28c34e2 then the Video object it was loaded into has a fps propertyLines 432 to 435 in 28c34e2 that returns the frames per second which you can use in conjunction with the frame index to calculate a relative timestamp (video starts at time 0). (sleap) roomrys:~$ipython
In [1]: from sleap import Labels
In [2]: ds = "/Users/roomrys/Projects/sleap-datasets/drosophila-melanogaster-
...: courtship/courtship_labels copy.slp"
In [3]: labels = Labels.load_file(ds)
In [4]: labeled_frame = labels.labeled_frames[0]
In [5]: video = labeled_frame.video
In [6]: frame_idx = labeled_frame.frame_idx
In [7]: video.fps
Out[7]: 25.0
In [8]: frame_idx / video.fps
Out[8]: 0.4 Sorry about that, |
Beta Was this translation helpful? Give feedback.
-
Just came across this which can be achieved with |
Beta Was this translation helpful? Give feedback.
-
Hi @roaldarbol, In case you haven't found your way over to this issue yet, there's a good discussion over here on the topic of video timestamps/accurate+fast seeking/encoding and etc: janclemenslab/napari-video#3 Hope that helps! FWIW, our setup is to store the timestamps separately from Bonsai as well. We pretty much entirely disregard the video FPS and "timestamps" stored in the video container metadata. Talmo |
Beta Was this translation helpful? Give feedback.
-
Hi again! :-)
I've tried to look through the documentation and the
.slp
file itself, but I can't find any timestamps. Does SLEAP not keep the timestamps from the video?Beta Was this translation helpful? Give feedback.
All reactions