Caption Convert
Overview
Convert subtitle files between SRT, WebVTT, and ASS using the local caption-convert CLI. Rely on file extensions to pick input/output formats and keep conversion notes in mind.
Quick Start
- Run after global install:
caption-convert input.srt output.vtt - Run from repo without install:
node .\\src\\cli.mjs input.vtt output.ass - Use extensions
.srt,.vtt, or.assfor both source and target - Requires Node.js 18+
Bundled Tool (scripts/cli.mjs)
If the repo is not available, use the bundled CLI in scripts/cli.mjs:
- Copy
scripts/cli.mjsinto a working folder. - Run directly:
node .\\cli.mjs input.srt output.vtt
Workflow
- Confirm the source/target paths end with supported extensions.
- Run the CLI from the repo or after a global install.
- Spot-check the output for timing and header correctness.
- Call out format limitations that may drop styling/metadata.
Format Notes and Limitations
- Infer formats strictly from filename extensions; unsupported or missing extensions exit with usage.
- Skip cues with invalid or unparseable time lines.
- Output
.vttalways includes aWEBVTTheader. - Convert
.assoutput with a fixed header and default styles; styling from source is not preserved. - Strip ASS override tags (
{...}) and convert\\N/\\nto line breaks on input.
Examples
caption-convert demo.srt demo.vtt
caption-convert demo.vtt demo.ass
node .\src\cli.mjs demo.ass demo.srt
Troubleshooting
- If the CLI prints usage, check that both paths are provided and use supported extensions.
- Ensure Node.js 18+ is available when running via
node.