Usage
srtshift [OFFSET] [options] <file>
The offset is the common case and comes first. Everything else is a flag.
Offset syntax
An offset is a signed duration. A leading + moves cues later, - moves them earlier. These are all valid:
| Written as | Means |
|---|---|
-1.5s | 1.5 seconds earlier |
+800ms | 0.8 seconds later |
-00:00:02,250 | 2.25 seconds earlier, timestamp form |
+90s | 90 seconds later |
Frame-rate rescale
When the track was timed for one frame rate and the video runs at another, a flat offset won't fix it — the error grows over time. Rescale instead:
srtshift --fps-from 23.976 --fps-to 25 movie.srt
Times are multiplied by the ratio of the two rates. You can combine a rescale with an offset if the track is both wrong-rate and shifted.
Limit to a range
Apply the change only to cues that start within a span, and leave the rest alone:
srtshift +3s --range 00:48:10,000-END part2.srt
--range takes START-END. Either side may be a timestamp, or the keywords START / END.
Options
| Flag | Effect |
|---|---|
-o <file> | Write the result to a new file. |
-i | Edit the input file in place. |
--fps-from / --fps-to | Rescale times between two frame rates. |
--fps <n> | Frame rate for frame-based formats (MicroDVD). |
--range <a-b> | Only retime cues starting in this span. |
--encoding <enc> | Force the input encoding instead of detecting it. |
--out-encoding <enc> | Encoding to write (default UTF-8). |
--no-bom | Omit the byte-order mark on UTF output. |
-n, --dry-run | Report what would change without writing. |
-q | Quiet: suppress the summary line. |
Examples
Two seconds later, in place:
srtshift +2s -i show.s01e03.srt
Fix a PAL-speedup track and save a copy:
srtshift --fps-from 25 --fps-to 23.976 -o out.srt in.srt
Check the drift before committing to it:
srtshift -4.2s --dry-run film.srt 1174 cues · first 00:01:12,400 → 00:01:08,200 · last 02:03:51,900 → 02:03:47,700