Subtitle conversion and cleanup for Rust - turn common caption formats into clean SubRip output.
- One crate, many subtitle formats - convert WebVTT, SAMI, SMPTE-TT/TTML, Bilibili JSON, MP4 ISMT, and MP4 WVTT into SubRip
- Library and CLI - use typed converters and processors in Rust, or run
captionrs convertandcaptionrs processfrom the command line - Automatic format detection - the CLI detects supported input formats and writes
.srtoutput directly - Structured subtitle model - work with
SubRipFileandSubtitle, then export or save with configurable encoding and line endings - Cleanup pipeline - fix common subtitle issues, normalize timing problems, remove short gaps, and strip SDH and speaker descriptions
- Sync and async APIs - converters and processors expose synchronous APIs, with Tokio-based async variants available behind the optional
asyncfeature - Language-aware processing - optional language hints can trigger RTL-specific cleanup during subtitle fixing
- Typed errors - parsing, format, and I/O failures are surfaced through
SubtitleError - Broad test coverage - sync and async paths are covered across converters, processors, and end-to-end subtitle workflows
[dependencies]
captionrs = "0.1.0"
# Enable the Tokio-based async library APIs:
# captionrs = { version = "0.1.0", features = ["async"] }Install the CLI with:
cargo install captionrs| Feature | Description |
|---|---|
async |
Enable Tokio-based async converters and processors for library integrations |
The CLI always runs synchronously. The async feature is only for library users who need to integrate captionrs into a Tokio-based application.
See the
examples/directory for format-specific conversions, sync and async workflows, processor chaining, and CLI-oriented examples.
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in captionrs by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.