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: parse WebVTT from fmp4 segments. #445

Merged
merged 3 commits into from
Sep 23, 2024
Merged

feat: parse WebVTT from fmp4 segments. #445

merged 3 commits into from
Sep 23, 2024

Conversation

adrums86
Copy link
Contributor

@adrums86 adrums86 commented Sep 23, 2024

Feature:

Add a module to parse WebVTT from fmp4 segments.

This module is based off of the ISO/IEC 14496-30 spec for carrying timed text data in ISOBMFF/FMP4 segments.

  • Parses the timescale from a WebVTT init segment.
  • Parses cue text, styles and timing data from WebVTT content segments.
  • Exports cue objects for each parsed WebVTT cue inside the content segment with the following format:
{
  cueText: 'Example cue text',
  start: 0,
  end: 1,
  settings: 'color: yellow;'
}
  • parseSegment returns an array of parsed cue objects for each WebVTT segment parsed which, contains all cues from the given segment.
  • Ignores both empty and invalid WebVTT cue data.

lib/mp4/webvtt-parser.js Outdated Show resolved Hide resolved
lib/mp4/webvtt-parser.js Outdated Show resolved Hide resolved
@adrums86 adrums86 merged commit 432b036 into main Sep 23, 2024
5 checks passed
@adrums86 adrums86 deleted the feat-mp4-WebVTT branch September 23, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants