srt-align DarkfullDante
winget install --id=DarkfullDante.srtAlign -e
a CLI tool to align a subrip file with video file
srt-align is a command-line tool designed to synchronize timestamps in an SRT (SubRip) file with a corresponding video source. This utility helps correct subtitle timing issues, ensuring that text appears on screen at the right moment.
Key Features:
- Shift Adjustment: Aligns subtitles by applying a proportional time shift, useful when the video and audio have different durations or playback speeds.
- Linear Adjustment: Corrects offsets caused by incorrect start times, allowing precise alignment of subtitle timestamps with the video.
- Timestamp Validation: Ensures that all adjusted timestamps conform to the standard SRT format (e.g., [-]##:##:##,###).
- File Handling: Supports overwriting the original file or generating a new output file named
-edited
.
Audience & Benefit:
Ideal for content creators, video editors, and anyone requiring precise subtitle alignment. By ensuring accurate synchronization between subtitles and video playback, srt-align enhances user experience and maintains professional quality in media production.
The tool can be installed via winget on Windows systems.
README
SRT Align
SRT Align is a CLI software that can edit timestamp in an SRT file (SubRip) to align the timing with the video Source. The tool can help for two types of offset:
- Shift: help with different duration of files and one source is faster than the other
- Linear: when the subtitle is always slightly before or being the video source due to wrong start time
Installation
Windows
Installer
- Download the most recent release (srt-align_Setup.exe)
- Run the installer
Manual
- Download the most recent release (srt-align.exe)
- Place the file in your folder of choice
- Add the location of srt-align.exe to your environnement variable (PATH) for access from anywhere in cmd/powershell
Linux
Manual
- Download the most recent release(srt-align)
- Place the file in your folder of choice
- Add a symbolic link in /usr/local/bin
Usage
The structure of the commands for the tool is has followed:
> srt-align {--shift|--linear} [OPTIONS...] \ [output]
Options
Option | Description |
---|---|
-h --help | Show the help panel |
-v --version | Show the package version |
-s --shift | Shifts the timestamp of a file based on a mutiple ratio (floating point value) where 1 means no change. |
-l --linear | Increase or decrease the timestamp value of a file based on a timestamp provided. The timestamp must be in a valid format for srt file ([-]##:##:##,###) |
-o --overwrite | Tells the program to overwrite the input file that was provided. |
A choice must be made between a shift alignement and a linear alignement. Both cannot be inputed at the same time.
Input/Output
- input: The input srt file that must be provided. This file is mandatory.
- output: The ouptut file for the srt file after modification. This item is optional. If this value is ommited, the file will be named after the input name with "-edited" at the end. The file will be placed in the input file directory.