Skip to content

feat(asr): improve subtitle cue formatting - #6

Open
hyperpuncher wants to merge 1 commit into
NVIDIA:mainfrom
hyperpuncher:feat/readable-subtitles
Open

feat(asr): improve subtitle cue formatting#6
hyperpuncher wants to merge 1 commit into
NVIDIA:mainfrom
hyperpuncher:feat/readable-subtitles

Conversation

@hyperpuncher

Copy link
Copy Markdown

summary

Make SRT and WebVTT subtitles easier to read by using one formatter for both the command line and HTTP API.

Previously, command-line subtitles could produce long single-line cues, reaching 83 characters in the one-minute test. HTTP responses could also place a whole recording in one subtitle.

The formatter:

  • splits subtitles at sentences, clauses, and pauses
  • uses up to two lines, targeting 37 characters and generally staying within 42 without breaking words
  • sets display time based on a reading speed of about 180 words per minute
  • displays each subtitle for 5/6 of a second to 7 seconds where timing permits
  • keeps the recognized text unchanged

These readability targets are informed by the
BBC subtitle guidelines
and Netflix's
general timed-text requirements
and
timing guidelines.
They are not a claim of full BBC or Netflix compliance.

provenance

The subtitle splitting and line wrapping were adapted from my MIT-licensed
chough formatter.

I own the copyright to that implementation and submit this C++ adaptation under this repository's Apache 2.0 license.

Signed-off-by: hyperpuncher <39203616+hyperpuncher@users.noreply.github.com>
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.

1 participant