Retime / resync captions
retime_captionsCorrect drifting captions by adjusting timing via frame-rate conversion, a stretch factor, or two sync points, so subtitles stay aligned from start to finish.
Instructions
Fix captions that drift (in sync at the start, increasingly off later). Three modes: fps — convert between frame rates (e.g. 23.976 → 25 PAL speed-up); factor — stretch by a multiplier; sync_points — give the correct time for two cues and everything is mapped linearly between them (most accurate).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"mode": "<mode>"
},
"name": "retime_captions"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| path | No | Local caption file (.srt, .vtt, .ass/.ssa, .json). ~ is expanded. | |
| factor | No | mode=factor: multiply all times by this. | |
| format | No | Input format. Detected automatically when omitted. | |
| to_fps | No | mode=fps: frame rate of the video they should match. | |
| content | No | Caption text, if you don't have a file. | |
| from_fps | No | mode=fps: frame rate the captions were timed for. | |
| overwrite | No | Allow replacing an existing file. | |
| output_path | No | Write the result here. Format follows the extension unless `to` is set. Omit to get the text back inline. | |
| sync_points | No | ||
| output_format | No | Output format. Defaults to the input format (or the output_path extension). |