SubFixr is a small command-line tool for fixing and cleaning subtitle files.
It's mainly for those moments when subtitles are slightly out of sync, or when you want to remove things like watermarks, ads, or unwanted lines quickly without opening a full editor.
It can shift SRT timestamps forward or backward, remove subtitle blocks by number, and drop blocks that contain matching text. If you have MKVToolNix installed, it can also extract subtitle tracks from .mks files or rebuild a new .mks after applying the same fixes.
- Python 3
- MKVToolNix on your
PATH(only needed for.mkssupport)
- Shift subtitle timing forward or backward
- Remove subtitle blocks by number or range
- Remove subtitle blocks that contain specific text
- Process a single file or a whole folder
- Walk subfolders with
--recursive - Write output next to the source file or to a custom path
- Rebuild
.mksfiles while keeping subtitle track order, language tags, and track names
python subfixr.py input [options]You need to pass at least one of these:
--shift--remove--delete-lines
-
inputSubtitle file (.srtor.mks) or a folder with subtitle files -
-s, --shiftShift amount like1s,500ms,1min, or plain seconds like1.5 -
-d, --directionforward/fororbackward/back -
--delete-linesSubtitle block numbers or ranges like1-8or1,3,5-7 -
--removeRemove subtitle blocks that contain the given text -
-o, --outputOutput file or folder -
-r, --recursiveScan subfolders too when the input is a folder -
--overwriteReplace output files if they already exist -
--mks-outputWhen the input is.mks, rebuild a new.mksinstead of writing extracted.srttracks
Shift one file forward by one second:
python subfixr.py file.srt -s 1s -d forShift every subtitle in a folder back by 500 ms:
python subfixr.py folder/ -s 500ms -d backProcess a folder recursively and write everything to another folder:
python subfixr.py folder/ -s 1min -d forward -o output_folder/ -rOverwrite files if the destination already exists:
python subfixr.py temp/ -s 2.5s -d backward --overwriteRemove subtitle blocks by number:
python subfixr.py file.srt --delete-lines 1-8Remove a few blocks, then shift the rest:
python subfixr.py file.srt --delete-lines 1,3,10-15 -s 750ms -d backRemove blocks that contain some text:
python subfixr.py file.srt --remove "viki"Process a folder and remove matching text before shifting:
python subfixr.py folder/ --remove "viki.com" -s 1s -d forExtract subtitle tracks from an .mks file and write them to a folder:
python subfixr.py file.mks -s 1s -d for -o output_folder/Rebuild a cleaned .mks while keeping the original subtitle container layout:
python subfixr.py file.mks --remove "viki" --mks-outputIf you combine options, SubFixr runs them in this order:
--delete-lines--remove- timestamp shift
- Output defaults to a new file next to the source (usually with
_syncedadded to the name) .mkssupport depends onmkvextractandmkvmergebeing available on your system
If you're dealing with a lot of files, try running it on a folder with --recursive first and without --overwrite, just to see what gets generated. Once you're happy, run it again with overwrite enabled.