Build an SRT file
build_srtTurn timed text segments into a valid SRT subtitle file. Sorts cues, drops empty entries, truncates conflicting overlaps, and wraps long lines for clean captions.
Instructions
Turn a list of timed text segments into a valid SRT subtitle file.
Pure text handling — no ffmpeg call, so this answers immediately. Segments are sorted, empty ones dropped, and overlapping cues truncated so they do not fight each other on screen. Long lines are word-wrapped. Feed the result to burn_captions, or edit it first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| segments | Yes | Timed text, in any order. | |
| max_lines | No | ||
| output_path | No | Where to write the .srt file; defaults to the workspace. | |
| max_chars_per_line | No | Wrap cues to this width. Null leaves the text unwrapped. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| duration | Yes | End time of the last cue, in seconds. | |
| cue_count | Yes | ||
| output_path | Yes | ||
| content_preview | Yes | First few cues, for a quick sanity check. |