merge_or_split
Combine two subtitle files with an optional time offset, or cut one at a specific time into two re-zeroed parts for SRT and WebVTT.
Instructions
Join two subtitle files or cut one in two. SRT and WebVTT only.
mode='merge': the cues of path2 are moved by offset_ms and combined with those of path (result sorted by start time, in the format of the first file). If offset_ms is omitted, the second file is placed right after the last cue of the first (typical for CD1 + CD2 rips). Use offset_ms=0 to overlay two files, such as two languages.
mode='split': cut at time at. Part 1 holds everything that starts before at; part 2
holds everything from at on, re-zeroed so at becomes 00:00:00. A cue that straddles the cut
appears in both parts (clipped to the cut in part 1).
Args: path: first (or only) file. mode: 'merge' or 'split'. path2: second file (merge only). offset_ms: milliseconds added to every cue of path2 (merge only; may be negative). at: split time such as 00:45:10,000 (split only). output: merged file / first part (default .merged. or .part1.). output2: second part (split only, default .part2.). overwrite: allow replacing existing output files (default false). encoding: force the input text encoding (applies to both inputs). output_encoding: encoding of the written files (default utf-8).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| at | No | ||
| mode | Yes | ||
| path | Yes | ||
| path2 | No | ||
| output | No | ||
| output2 | No | ||
| encoding | No | ||
| offset_ms | No | ||
| overwrite | No | ||
| output_encoding | No | utf-8 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |