Skip to content

Hayder-IRAQ/srt-subtitle-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎬 SRT Subtitle Sync Tool

Fix subtitle timing in seconds β€” single files or entire folders, with a clean modern GUI.

Python CustomTkinter License: MIT Platform


πŸ”§ The Problem

You download a movie subtitle file and the text is always 0.5 seconds too early or 2 seconds too late. Every single line. Fixing them one by one is impossible.

SRT Subtitle Sync Tool shifts all timestamps in one click.


✨ Features

Feature Details
⏱️ Precise timing Adjust by any amount β€” e.g. -0.5, +2, -1.3 seconds
πŸ“ Batch processing Add individual files or scan an entire folder recursively
πŸš€ Quick buttons One-click presets: -2s, -1s, -0.5s, +0.5s, +1s, +2s
πŸ’Ύ Flexible output Save with custom suffix, to a different folder, or overwrite original
πŸ”’ Safe by default Creates _Synced copies β€” never overwrites unless you choose to
πŸŒ™ Modern dark UI Built with CustomTkinter
πŸ”  Encoding support Handles UTF-8, UTF-8 BOM, and Latin-1 (older SRT files)
⚑ Non-blocking Processing runs in a background thread β€” UI stays responsive

πŸš€ Quick Start

1. Install dependency

pip install customtkinter

2. Run

python main.py

3. Use

  1. Click Add Files or Add Folder to select your .srt files
  2. Enter the time offset (e.g. -0.5 to shift subtitles 0.5 seconds earlier)
  3. Choose output settings (suffix, folder, or overwrite)
  4. Click START SYNC πŸš€

πŸ“Έ Screenshot

Coming soon


πŸ“¦ Requirements

Package Purpose
customtkinter Modern dark-themed GUI
tkinter Built into Python β€” no install needed

Everything else (re, threading, pathlib, datetime) is Python standard library.


βš™οΈ How It Works

SRT timestamps look like this:

00:01:23,456 --> 00:01:25,789

The tool finds every timestamp with a regex pattern and shifts it by your specified offset using Python's datetime + timedelta. Negative times are clamped to 00:00:00,000 automatically.


πŸ—‚οΈ Project Structure

srt-subtitle-sync/
β”œβ”€β”€ main.py          # Full application (single file)
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ LICENSE
└── README.md

πŸ’‘ Example

Subtitles appear 1 second too late:

  • Enter -1 in the time field
  • Click START SYNC
  • Done β€” all timestamps shifted back by 1 second

Subtitles appear 2.5 seconds too early:

  • Enter +2.5
  • Click START SYNC

🀝 Contributing

Contributions welcome! Ideas:

  • Support for .ass / .vtt subtitle formats
  • Preview before saving
  • Auto-detect offset from audio

Fork β†’ feature branch β†’ PR.


πŸ“„ License

MIT License β€” see LICENSE for details.


πŸ‘€ Author

Hayder Odhafa / حيدر عذافة GitHub: @Hayder-IRAQ


Made with ❀️ β€” SRT Subtitle Sync Tool v1.0 Β© 2025 Hayder Odhafa

About

🎬 Fix subtitle timing in seconds β€” batch process SRT files with a modern dark GUI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages