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, retime subtitles from one FPS to another, 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
- Retime subtitles from one FPS to another
- 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--fps--remove--delete-lines
-
inputSubtitle file (.srtor.mks) or a folder with subtitle files -
-s, --shiftShift amount like1s,500ms,1min, or plain seconds like1.5 -
--fpsSubtitle FPS retime insource:targetorsource targetformat like25:23.976,25 23.976, or24000/1001:25 -
-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 forConvert one subtitle from 25 FPS timing to 23.976 FPS timing:
python subfixr.py file.srt --fps 25:23.976The same FPS change using two separate values:
python subfixr.py file.srt --fps 25 23.976Shift 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 backRetime by FPS first, then add a small forward shift:
python subfixr.py file.srt --fps 24000/1001:25 -s 300ms -d forRemove 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" --fps 25:23.976 --mks-outputIf you combine options, SubFixr runs them in this order:
--delete-lines--remove- FPS retime
- 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.