Import subtitles
import_subtitlesConvert and import SRT or WebVTT files as Kdenlive-compatible ASS subtitles, with frame-rounded timing, styling conversion, and optional offset or replacement of existing subtitles.
Instructions
Import a SubRip (.srt) or WebVTT (.vtt) file, UTF-8 or UTF-16 with a byte order mark, as the main sequence's subtitles, in Kdenlive's own format: an ASS file named after the saved project (<destination>.ass) with Kdenlive's default style. Times are rounded to frames; overlapping subtitles go to separate layers; , , become ASS styling, other styling is dropped (warnings). Existing subtitles are refused ([subtitles_exist]) unless replace=true; written to a new destination their file is untouched, replaced in place it is backed up first. offset shifts every subtitle by that many frames. The result is written to destination with the save_project_copy rules.
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": {
"path": "<path>",
"subtitle_file": "<subtitle_file>",
"destination": "<destination>"
},
"name": "import_subtitles"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path of a .kdenlive project file on this machine. | |
| offset | No | Frames added to every subtitle. | |
| replace | No | ||
| sequence | No | Sequence uuid or name; default: active sequence. | |
| overwrite | No | Allow replacing an existing destination file. | |
| destination | Yes | Absolute path of the .kdenlive file to write (the source by default is never modified; see save_project_copy for the overwrite rules). | |
| subtitle_file | Yes | Path of the .srt or .vtt file. | |
| expected_sha256 | No | Required to write over the source: its sha256 as last read. Tools that take `revision` use it when this is omitted. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| audio | No | ||
| media | No | ||
| saved | Yes | ||
| title | No | ||
| track | No | ||
| relink | No | ||
| effects | No | ||
| markers | No | ||
| timeline | No | ||
| subtitles | No |