bvibber / ogv.js

JavaScript media player using Ogg/Vorbis/Theora/Opus/WebM libs compiled with Emscripten
https://brooke.vibber.net/misc/ogv.js/demo/
Other
1.2k stars 101 forks source link

Play Frame by Frame with a slider (fastSeek) #551

Open Schizo opened 4 years ago

Schizo commented 4 years ago

I'm trying to be able to play a video frame-by-frame for analysis purposes. An example would be this.

So I've and hooked up the oninput of the range slider with player.currentTime = 8.3 / 100 * value;. The 8.3 is the duration of the file. However, this is jittery and it has troubles refreshing every frame. I first thought there is a buffer of frames it keeps in cache, but I couldn't tell how big that buffer is, as I couldn't deduce it from the behavior, nor I wasn't sure where to check that in the chrome/firefox debugger.

Then I found the fastSeek function as part of the player class, YES!! but it expects keyframes to do fast seek. No problem, I've generated a webm file with a keyframe interval of 1 and then hooked up the snippet player.fastSeek(value). But that didn't help either.

I wen't over https://github.com/brion/ogv.js/issues/433, so for small ranges that should actually work right? The Files I'm inspecting are short clips of ~200 Frames.

Thanks!

bvibber commented 4 years ago

I've gotten some similar feedback about fastSeek not acting as expected in this scenario, just haven't had the time to track it down yet. Will take a peek later this week at both...

Schizo commented 4 years ago

Sounds good! Feel free to send anything you need to be tested.

yafesdev commented 4 years ago

I did some tests and while I have the same behaviour as @Schizo mentioned for dav1d I had no issues using the VP8 decoder.