Skip to content

Increment a subtitle file in time to fix audio subtitle timing issues

License

Notifications You must be signed in to change notification settings

Michaeljurado42/subtitle-increment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Command changes the timestamps of an srt file using a constant time increment. This can be useful if an srt file lags behind or in front of a movie you want to watch

Installation

pip install subtitle-increment

Usage

python -m subtitle_increment --help
usage: __main__.py [-h] [--seconds SECONDS] [--milliseconds MILLISECONDS]
                   [--output OUTPUT]
                   file_name

Increment subtitle file

positional arguments:
  file_name             Subtitle file to increment

optional arguments:
  -h, --help            show this help message and exit
  --seconds SECONDS, -s SECONDS
                        seconds to increment dialogue
  --milliseconds MILLISECONDS, -ms MILLISECONDS
                        milliseconds to increment dialogue
  --output OUTPUT, -o OUTPUT
                        output file name of incremented subtitle. Defaults to
                        new_subtitle.srt

Example

python -m subtitle_increment La.Notte.1961.1080p.BluRay.x264-PublicHD.ita-Italian.srt -s -5 -ms -100 --output new_subtitles.srt

This command decrements all the dialogue in the subtitle file by 5 seconds and 100 milliseconds. The output srt file is new_subtitle.srt

Quirks

  • Program assumes utf-8 encoding. (If you get an encoding error just copy the contents into another newly generated plain text file)
  • No Unit Tests since code is brutally simple

About

Increment a subtitle file in time to fix audio subtitle timing issues

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages