convert
Transforms SRT, WebVTT, ASS, and SSA subtitle files into another format or re-encodes them while preserving timing and text.
Instructions
Convert between SRT and WebVTT, turn an ASS/SSA file into SRT or VTT, or just re-encode a file (same format in and out, for example cp1254 Turkish -> UTF-8). Timing and text are kept. What cannot be carried over is listed in the answer: ASS styling (fonts, colours, positions, effects) is always dropped, WebVTT cue settings and NOTE/STYLE/REGION blocks do not exist in SRT, and blank lines inside a cue are removed because both formats end a cue at a blank line.
Args: path: .srt, .vtt, .ass or .ssa file. to_format: 'srt' or 'vtt'. output: where to write (default: .converted.). overwrite: allow replacing an existing output file (default false). encoding: force the input text encoding. output_encoding: encoding of the written file: utf-8 (default), utf-8-sig, utf-16, cp1254, cp1252, iso-8859-9, ...
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| output | No | ||
| encoding | No | ||
| overwrite | No | ||
| to_format | Yes | ||
| output_encoding | No | utf-8 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |