-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
video.currentTime is not precise enough to indentify a frame #433
Comments
See this discussion for how a switch to frame numbers instead of times could be accomplished. However, it's probably hard to keep an independent timer to track the video progress synchronized with the video (e.g. if it buffers, is paused, the playback rate changes etc.). |
These improvements were discovered while investigating #433.
Also related: w3c/media-and-entertainment#4 |
The actual workaround is to set video.currentTime = video.currentTime whenever the video is paused. The other changes attempt to remove the flickering of the video in these cases (because the video is rendered blank while seeking). This does not work in all cases yet. References #433
PR #444 implements a workaround where the video frame is updated whenever the video is paused. The updated frame exactly shows the frame corresponding to |
Tator implements an elaborate video playback mechanism (see discussion linked above) but I believe it relies on custom video re-encoding (with fixed and known parameters). This could be one thing we could copy to get accurate annotation times. Another tool that seems to be quite sophisticated in this regard is DIVE, which we also could take a look at. |
Here is an example how a video could be rendered frame by frame using the Web Codecs API: https://stackoverflow.com/a/32708998/1796523 |
Here is a project that renders videos using the WebCodecs API: https://github.com/aegir-assembly/omni-clip Another thing to consider is that with WebCodecs we can only support remote files with CORS enabled (similar to the image annotation tool). |
Apparently,
video.currentTime
can be modified/rounded by the browser for security reasons. This means that the value returned bycurrentTime
is not precise enough to identify the video frame. The following observation confirms this issue: If the video is played and paused and thenvideo.currentTime = video.currentTime
is set, the displayed video frame is updated most of the time! Try it in this fiddle.The issue that frame-accurate handling of videos is not really possible in the browser is discussed for a long time. I don't know how we can handle this, yet, but it might become complicated.
The text was updated successfully, but these errors were encountered: