What is coming in captions.js 2.0
New caption styles, a caption track with speakers, events and emphasis, more input formats and a React package. Planned for early January.
captions.js 2.0 is planned for early January. Until now the library had one goal: captions that look good. 2.0 keeps that and adds three more: accurate, emotional and expressive. The renderer stays the same in the browser and in FFmpeg.
New styles
2.0 adds a set of new styles to the current 26. Several of them need engine features that 1.x does not have, such as per-word size and effects that see every word on screen. Keyword Blowup enlarges and recolors numbers and trigger words. Typewriter reveals characters one at a time. The full list is in the Coming soon tab on the home page.
Layout also changes. Lines now break on measured word widths, and a line that is too wide shrinks to fit. Decoration such as padding, stroke and shadow scales with the font, so a preset looks the same at 480 px and at 1080 px.
A richer caption track
A new CaptionTrack type carries more than words and times:
- Speakers. A style can give each speaker a color or a label.
- Events. Laughter, music and applause become their own timed elements.
- Emphasis. One number per word, from 0 to 1, plus where it came from.
Every field beyond word, start and end is optional. A plain Caption[] is still accepted
everywhere and renders exactly as it does today. Each extra signal switches on one more behavior.
Screens now break at pauses and at speaker turns, not only at a character count.
Emphasis from a mark or from an LLM
There are three manual ways to emphasize a word: set emphasis in the data, write *word*
in any text input, or click the word in the playground. An LLM can do the same job through
an annotations file, which the library validates and applies. The library never calls a
model itself.
When sources disagree, a manual mark wins. One expressiveness setting from 0 to 1 controls
how strongly a style reacts; 0 is today's look.
More inputs, one path
Adapters for Whisper verbose_json, whisper.cpp, SRT, VTT, AssemblyAI and ElevenLabs join
the existing Deepgram adapter. They live in core, so the browser and the CLI accept the same
files. validate(track) reports overlaps, reversed times and non-finite values.
React
@captionsjs/react ships with 2.0: a component for apps that already use React.
Breaking changes
2.0 is a major version, and a few things change:
renderFrametakes an options object. The positional form still works and is deprecated.- Konva moves to
peerDependenciesin core. renderStringis removed.
Each change has a line in MIGRATION.md.
Known limits
Right-to-left text is not supported yet. SRT and VTT have no word times, so word timing for those files is interpolated. Emphasis from audio loudness is not in 2.0; it is planned as a separate package after the release.
Try it early
Pre-releases will go to the next tag on npm before the release. Issues found before 2.0
ships are the most useful ones, and they belong on
GitHub.
The library stays MIT-licensed, on npm and developed in the open.