I have a bunch of subtitle files (all
.srt) which don't really match the videos they belong to. The problem is two-fold:
- The video's intro has been cut off, but the subtitles still expect it to be there.
- There are certain "intermezzos" (or transitions) which also appear to be shortened relative to the subtitles. For example, That 70s Show has a few transitions per episode where some cast members are basically messing around in front of the camera for a couple seconds. Now imagine that every transition is shortened by 1 or 2 seconds as opposed to what the subs expect.
Now, for point 1 I can simply timeshift the entire subtitle file so the first line for both is in sync. However, I can't simply shift the entire file again for those transitions in point 2, because that would mess it up again. So I'm looking for a tool that supports e.g.
-t 10:00:00 -s +2.0 and it will only shift the subs by 2 seconds from the 10 minute mark on, leaving everything before it alone. Ideally, it also supports in-place replacement/updating of the existing file, but it's no big deal if it doesn't.
It doesn't seem to be a problem with slightly different framerates (e.g.
24), because when I figure out by how much to shift the subs (usually whole seconds), it consistently matches the video until the next transition. It's not slowly becoming desynced as the episode goes on.
The tool must be without a GUI because the subtitle/video files live on a Linux box without a desktop environment and installing one just for shifting subs is way overkill. I also want to keep all that stuff together on the same device. It doesn't have to be a compiled executable, a Python script or whatever would be fine too.