Streaming command and module that reads SRT data and a time offset and outputs the resultant SRT.
resync-srtas a command, install it using npm:
$ npm install -g resync-srt
You can feed it either files or raw data from stdin:
$ resync-srt 500 1 00:00:00,000 --> 00:03:00,000 Hello, warld! ^D
which will output
1 00:00:00,500 --> 00:03:00,500 Hello, warld!
If this data was in an
.srtfile you could also use the filename as the first argument:
$ resync-srt foo.srt -1000
resync-srt [FILE] MILLISECOND-OFFSET
var resync = require('resync-srt')
resync-srtexports a single method, which accepts an offset in millseconds. Positive values push the timestamps forward in time, while negative values push them backward.
This returns a Transform stream: reading SRT data and outputting SRT data that has been time-shifted.