submv allows you to shift a subtitle file by a given amount to synchronize it to a video stream using a simple command line tool.
In a console, simply type
submv path/to/subtitles.srt -1.5to shift the file subtitles.srt by -1.5s. By default, it will overwrite the original file.
More options:
- The shifted subtitles can be written to a new file by using the
--outputflag (or-ofor short). Example:submv file.srt 2.1 --output new_file.srt. - The default format is SubRip (
*.srtfiles). Other formats can be read using the--formatflag (or-ffor short). Example:submv file.sub --format sub. - For certain formats such as MicroDVD (
*.subfiles), the timecodes depend on the video framerate. To account for this, the correct framerate must be specified with the--framerateflag (or-rfor short). Example:submv file.sub --framerate 30.
1. From PyPI:
pip install submv2. From the code repository:
git clone https://github.com/jorisparet/submv
cd submv
pip install .
The default folder should be under /home/<user>/.local/bin/. Make sure this location (or the correct one, if different) is included in your $PATH environment variable to be able to run the scripts from the console. If not, type the following command export PATH=$PATH:/path/to/submv/script/ in the console or add it your .bashrc file.
The default folder should be under C:\Users\<user>\AppData\Local\Programs\Python\<python_version>\Scripts\. Make sure this location (or the correct one, if different) is included in your $PATH environment variable to be able to run the scripts from the console. If not, type the following command set PATH=%PATH%;C:\path\to\submv\script\ in the console, or select Edit the system environment variables in the search bar, click Environment Variables…, click PATH, click Edit... and add the correct path to the scripts.