Re: [media-and-entertainment] Frame accurate seeking of HTML5 MediaElement

Assuming that framerates are uniform is going to go astray at some point, as mp4 can contain media with different rates.
The underlying structure has Movie time and Media time - the former is usually an arbitrary fraction, the latter a ratio specifically designed to represent the timescale of the actual samples, so for US-originated video this will be 1001/30000.

Walking through the media rates and getting fame times is going to give you glitches with longer files

If you want to construct an API like this I'd suggest mirroring what QuickTime did - this had 2 parts: the movie export API, which would give you callbacks for each frame rendered in sequence, telling you the media and movie times.
Or the GetNextInterestingTime() API which you could call iteratively and it would do the work of walking the movie, track edits and media to get you the next frame or keyframe.

Mozilla did make seekToNextFrame, but that was deprecated:
 https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/seekToNextFrame

-- 
GitHub Notification of comment by kevinmarks-b
Please view or discuss this issue at https://github.com/w3c/media-and-entertainment/issues/4#issuecomment-397257475 using your GitHub account

Received on Thursday, 14 June 2018 11:08:54 UTC