Shift the timing of an SRT file
shift_srt_fileShift every caption in an .srt file by a seconds offset (negative moves earlier), then write the adjusted file; captions pushed before zero are dropped or clamped unless strict mode is enabled.
Instructions
Add an offset in seconds to every caption of an .srt file (negative = earlier) and write the result. Captions that would end before 0 are dropped and ones that would start before 0 start at 0, unless strict=true makes that an error. Writes to output_path (default: the same file, which needs overwrite=true). Works on the file directly; Premiere is not needed. To shift captions already on a sequence, re-import the shifted file. Returns file_path, count, dropped, clamped, first_start and last_end.
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": {
"file_path": "<file_path>",
"offset": "<offset>"
},
"name": "shift_srt_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offset | Yes | Seconds added to every start and end time. Negative moves captions earlier. | |
| strict | No | Fail instead of dropping or clamping captions pushed before 0. Default false. | |
| file_path | Yes | The .srt file to read. Absolute path. | |
| overwrite | No | Replace output_path if it exists (required when writing over the source). Default false. | |
| output_path | No | Where to write the shifted file. Absolute path. Default: file_path itself. |