Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
WofWca opened this issue Mar 15, 2023 · 0 comments
Open

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

WofWca opened this issue Mar 15, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@WofWca
Copy link
Owner

WofWca commented Mar 15, 2023

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:

const maybeUpcomingSilenceRange = this.lookahead?.getNextSilenceRange(currentTime);

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 WofWca added the enhancement New feature or request label Mar 15, 2023
@WofWca WofWca changed the title feat: new skipping algorithm: based on captions (subtitles) feat: new skipping algorithm: based on caption (subtitle) timing Mar 15, 2023
@WofWca WofWca changed the title feat: new skipping algorithm: based on caption (subtitle) timing feat: new skipping algorithm: based on caption (subtitle) timings Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant