Submarine is a toolkit for subtitles translation with LLM assistance.
I prefer watching movies, cartoons, and anime with the original audio. However, subtitles are often unavailable in my language. While we can now use LLMs to translate subtitles, they aren't perfect. They sometimes make mistakes, such as messing up subtitle numbering or timestamps. Even the best models fail often.
Beyond missing subtitles, they can be incomplete or have compatibility issues with different releases. Submarine is designed to assist the translation process by providing various editing and validation tools. It helps ensure that translated subtitles are accurate and consistent with the original content.
- Supported format: SubRip (srt)
- Supported flows:
- Toolset:
- Get subtitle by index or range
- Add a new subtitle
- Set/update subtitle properties
- Import subtitles from file (CSV, anchored format)
- Adjust timestamps by offset
- Mass-rename subtitle files
- Export subtitles in anchored format
- Diagnose and fix file issues (
doctor)
- Verification:
- Verify translated subtitles against the original content
- Track translation progress
- Agent-friendly:
- Structured JSON output (
--output json) on all commands - Dry-run preview (
--dry-run) on all mutating commands - Schema introspection (
sm describe) - Machine-readable error codes and hints
- Structured JSON output (
- Auto-backups: automatically create backups of your subtitle files before making changes.
macOS (Homebrew), Linux, Docker — see docs/install/.
Task-oriented recipes for real subtitle problems — syncing, merging, comparing, and cleaning up — with copy-paste commands and expected output. Full index — docs/usecases/, including:
Articles
- How I Translate Subtitles with LLMs
- How I Translate Podcasts with LLMs
- Creating Subtitles from a Dubbed Track
Guides:
- Merge an incomplete translation with a donor file
- Detect and fix a constant sync offset
- Fix frame-rate drift (23.976 ↔ 25)
- Re-sync only part of a file
- Join split parts (CD1/CD2) into one file
- Compare two subtitle tracks
- Normalize structure: sort, renumber, fix overlaps
- Remove duplicates and overlaps after merging
- Find missing dialogue with gap analysis
In addition to its command-line interface, Submarine can be used as a library in your own Rust projects. For detailed information on how to integrate it, please see the library documentation.
