srtshift

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 asMeans
-1.5s1.5 seconds earlier
+800ms0.8 seconds later
-00:00:02,2502.25 seconds earlier, timestamp form
+90s90 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

FlagEffect
-o <file>Write the result to a new file.
-iEdit the input file in place.
--fps-from / --fps-toRescale 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-bomOmit the byte-order mark on UTF output.
-n, --dry-runReport what would change without writing.
-qQuiet: 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