Clean up captions
clean_captionsCleans caption files by trimming whitespace, removing empty cues, sorting and merging duplicates, fixing timing overlaps/gaps, and renumbering; optionally strips sound tags and speaker labels.
Instructions
Automatic tidy-up: trims whitespace, drops empty and zero-length cues, sorts by time, merges back-to-back duplicates, fixes overlaps and flicker gaps, extends too-short cues where there is room, renumbers. Optionally removes sound descriptions like [MUSIC] or (laughs) and speaker labels.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "clean_captions"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Local caption file (.srt, .vtt, .ass/.ssa, .json). ~ is expanded. | |
| format | No | Input format. Detected automatically when omitted. | |
| content | No | Caption text, if you don't have a file. | |
| overwrite | No | Allow replacing an existing file. | |
| min_gap_ms | No | Minimum gap between cues (83 ms ≈ 2 frames at 24 fps). | |
| output_path | No | Write the result here. Format follows the extension unless `to` is set. Omit to get the text back inline. | |
| output_format | No | Output format. Defaults to the input format (or the output_path extension). | |
| min_duration_ms | No | ||
| merge_duplicates | No | ||
| remove_hearing_impaired | No | Strip [SOUND], (sound), ♪ and 'SPEAKER:' labels. |