ajayyy / SponsorBlock

Skip YouTube video sponsors (browser extension)
https://sponsor.ajay.app
GNU General Public License v3.0
10.18k stars 323 forks source link

Integrate frame-by-frame seeking #964

Closed Topkek-190 closed 3 years ago

Topkek-190 commented 3 years ago

Currently, youtube's frame by frame seeking is inaccurate. Playing the video at .25x and pausing-unpausing is the only method to get accurate start-end times and the method isn't foolproof as there can still be inaccuracies in submitted times. Will it be possible to integrate frame-by-frame seeking into Sponsorblock itself?

mchangrh commented 3 years ago

frame by frame seeking with , and . seems to fare pretty well, and times can be edited down to the ms in the preview bar, what issues were you having with it?

Topkek-190 commented 3 years ago

HTML5 frame seeking isn't properly supported in all browsers http://www.inconduit.com/smpte/

mchangrh commented 3 years ago

firefox 4 nightly chromium 71676 - Jan 2011 IE9 WebKit 100% accurate - Feb 2017

video elements are widely supported across all browsers https://caniuse.com/video

which browser are you using that you're having trouble seeking frame by frame?

Topkek-190 commented 3 years ago

Visiting http://www.inconduit.com/smpte/ and seeking by 16 frames causes the video to show 15 in the timecode and 16 in the calculated timecode

ajayyy commented 3 years ago

frames don't matter most of the time since audio is has significantly more precision

mchangrh commented 3 years ago

also, as discussed in the linked mailing list, the SMPTE timing is not the same as ms timings and will differ for videos with or without DF and by framerates. The issue of STMPE timings not being accurate does not mean that the youtube seek is not accurate, it means that the youtube seek isn't accurate to the actual SMPTE frame.

However, most submissions still need a "two frame" buffer on firefox and timings are based on ms. As long as playback is identical between browsers, then the SMPTE timing variance won't matter since SB is going by millisecond timings.

Topkek-190 commented 3 years ago

The problem starts when you seek using the seek bar. The seek bar doesn't seek using frames, it seeks using time, so let's assume a video is 25fps. One frame will be 1000/25ms or 40ms. But if you seek using the seek bar, most of the time, the video's current time gets set to a time that doesn't correspond to frames, i.e. a redundant one, e.g. 0.960 and 0.973 correspond to the same frame in a 25fps video.

ajayyy commented 3 years ago

SponsorBlock doesn't use frames either, it uses time

Topkek-190 commented 3 years ago

I know Sponsorblock does not use frames but two times corresponding to the same frame are redundant

mchangrh commented 3 years ago

two times on the same frame isn't redundant since it's not just visuals being cut out but the audio, I've had to adjust multiple segments for audio where it was on the same 'frame' but the ms timings did matter

Topkek-190 commented 3 years ago

I understand. Will it be possible to implement -1 frame and +1 frame buttons in the edit menu?

Topkek-190 commented 3 years ago

Since audio consists of many samples, will it be possible to represent audio graphically(ideally with a waveform) along with a seek-bar?

Topkek-190 commented 3 years ago

Closing and opening a new issue.