microsoft / VoTT

Visual Object Tagging Tool: An electron app for building end to end Object Detection Models from Images and Videos.
MIT License
4.31k stars 838 forks source link

How to calculate video frame number from VoTT exported image timestamp #1041

Open haimat opened 3 years ago

haimat commented 3 years ago

When I export tagged frames from a video via VoTT, I get a list of all exported images in a CSV file. Each of these images contain their timestamp from within the video in their file names. For example:

video.mp4#t=260.433333.jpg

Now I want to calculate which frame this image is in the video. So in this example when this video.mp4 has 60 FPS, I would assume that I can simply calculate that frame number via

timestmap * fps = int(260.433333 * 60) = 15626

Thus I would assume that timestamp 260.433333 corresponds to frame number 15626 in the video. As it turned out, however, this is close, but not exactly correct. After some manual tweaking I found out the correct frame number is 15610. The further I go in video time, the greater this difference becomes.

Now I am wondering: Where does this difference of 16 frames come from, and how do I correctly calculate the frame number from these timestamps?

haimat commented 3 years ago

Hello there, any ideas on this issue?