jumpcutter icon indicating copy to clipboard operation
jumpcutter copied to clipboard

feat: new skipping algorithm: based on caption (subtitle) timings

Open WofWca opened this issue 2 years ago • 1 comments

Fadi suggested this.

It can work for videos that have captions/subtitles (YouTube can even auto-generate them). Each caption has a time range that is supposed to be displayed for:

WEBVTT

00:01.000 --> 00:04.000
- Never drink liquid nitrogen.

00:05.000 --> 00:09.000
- It will perforate your stomach.
- You could die.

We could simply skip every range that doesn't have captions (subtitles?). Fortunately, the cloning algorithm already implements skipping according to an array of time ranges, so it's a matter of bootstrapping stuff:

https://github.com/WofWca/jumpcutter/blob/90931ad3b1979aa1be141e3c8dc6b8ceea891bfb/src/entry-points/content/ElementPlaybackControllerCloning/ElementPlaybackControllerCloning.ts#L427

See https://developer.mozilla.org/en-US/docs/Web/Guide/Audio_and_video_delivery/Adding_captions_and_subtitles_to_HTML5_video for more on captions in browsers.

WofWca avatar Mar 15 '23 18:03 WofWca

Another project implements the captions algorithm!

https://github.com/WojtekTB/UCSD-Silence-Fast-Forward/blob/main/scripts/helper_functions.js#L157

WofWca avatar Aug 16 '24 08:08 WofWca