1. The subtitle file to fix
2. How to find the right timing
3. Result
1stretch 0 sshift 0cues written
| # | Was | Now | Text |
|---|
Prefer the command line?
The same engine as a zero-dependency Node script, for batches or a media server's folder:
node resync.mjs movie.srt --offset -2.5 -o fixed.srt node resync.mjs movie.srt --fps 25:23.976 -o fixed.srt node resync.mjs movie.srt --sync 00:02:00,000=00:02:07,125 --sync 01:30:00,000=01:33:52,625 node resync.mjs movie.es.srt --reference movie.en.srt -o movie.es.fixed.srt
Get resync.mjs and engine.mjs from the repo, plain Node 18+. Exit code 1 when a reference alignment comes back low confidence (the file is still written), 2 on a usage or input error.
Common questions
Why do my subtitles start in sync and then drift further and further off?
That is almost always a frame-rate mismatch, not an offset. The subtitle file was timed against a release running at a different speed, most often a 25 fps PAL release, which plays a 23.976 fps film about 4.3% faster. The error grows steadily, to about four minutes by the end of a 100-minute film. Pick the frame-rate fix (25 to 23.976 is the usual one), or use two sync points, which measure the stretch for you.
How does the reference alignment work if the two files are in different languages?
It never reads the words. Dialogue has a rhythm: lines start and stop at the same moments in every language's subtitles for the same cut. Every pair of cues votes for the shift that would put one on the other; real matches all vote for the same shift while unrelated pairs scatter. It tries every common frame-rate ratio, keeps the one whose best shift gathers most votes, then fits a line through the cues that land close to a reference cue.
What does the confidence rating mean?
High means at least 60% of your cues landed within 0.4 seconds of a reference cue and the median error is 0.25 seconds or less. Medium means at least 35% landed. Low means the timing patterns do not agree, which usually means the reference is for a different cut (an extended edition, a TV edit with scenes removed) or a different film. Check a low-confidence result by eye, or use two sync points instead.
Is my subtitle file uploaded anywhere?
No. The file is read and rewritten by JavaScript in this page, on your device. Nothing is sent to a server, and the download is generated in the browser.
More: a step-by-step guide to telling an offset from a frame-rate drift, with a worked example.