vidstack / player

UI components and hooks for building video/audio players on the web. Robust, customizable, and accessible. Modern alternative to JW Player and Video.js.
https://vidstack.io
MIT License
2.36k stars 137 forks source link

Add support for SMPTE timecode #809

Open njsauriol opened 1 year ago

njsauriol commented 1 year ago

Describe:

Add support form SMPTE timecode in player.

Alternatives:

For reference - VideoFrame - HTML5 Video SMPTE Time Code and Frame Seeking API

Anything Else?

SMPTE timecode is presented in hour:minute:second:frame format, where sub-second timecode time values are expressed in terms of frames (instead of milliseconds), based on the video/audio framerate.

Most commonly used framerates: 23.976 (23.98), 24, 25, 29.97, 30, 59.94, 60

ThaUnknown commented 1 year ago

VideoFrame isn't a good solution for this, it effectively just tries it's best to guess, which doesn't work well at all for variable framerate videos [mkv and webm], you're way better off using requestVideoFrameCallback() which is supported by most browsers, and those that don't support it can use a roughly accurate polyfill which uses frame rendering stats, but the polyfill suffers from the same issues as VideoFrame