@catlabtech/webcvt-subtitle
v0.1.0
Published
Browser-first subtitle conversion for webcvt — SRT, VTT, ASS, SSA, MicroDVD, MPL2
Readme
@catlabtech/webcvt-subtitle
Browser-first subtitle conversion for the webcvt ecosystem. Converts between SRT, WebVTT, ASS/SSA, MicroDVD (.sub), and MPL2 formats — pure TypeScript, no WASM, no third-party parsers.
Supported Formats
| Format | Ext | Parse | Serialize | Notes | |----------|-------|-------|-----------|--------------------------------| | SubRip | .srt | yes | yes | Full round-trip, HTML tags | | WebVTT | .vtt | yes | yes | Cue settings preserved | | ASS | .ass | yes | yes | Style fields parsed; text only | | SSA | .ssa | yes | yes | V4 styles (delegates to ASS) | | MicroDVD | .sub | yes | yes | Frame-based, default 23.976fps | | MPL2 | .mpl | yes | yes | Decisecond timestamps |
VobSub binary .sub files are out of scope — the parser throws a clear error when binary magic is detected.
Usage
import { SubtitleBackend } from '@catlabtech/webcvt-subtitle';
import { defaultRegistry } from '@catlabtech/webcvt-core';
const backend = new SubtitleBackend();
defaultRegistry.register(backend);Or use the parsers directly:
import { parseSrt, serializeVtt } from '@catlabtech/webcvt-subtitle';
const track = parseSrt(srtText);
const vttText = serializeVtt(track);License
MIT
