Skip to main content

A small CLI tool to extend subtitle durations in SRT files by redefining gaps between subtitles.

Project description

SubGapFix

A small Python CLI tool to extend subtitle durations in .srt files so they stay on screen longer and feel more natural to read.
Designed especially for subtitles generated by WhisperX, which often have very tight timings.

✨ Features

  • Automatically extends subtitles when there’s a gap before the next subtitle.
  • Prevents overlaps by adjusting start/end times safely.
  • Configurable via CLI arguments.

📦 Installation

Clone the repository and install dependencies:

git clone https://github.com/yourusername/subgapfix.git
cd subgapfix
pip install -r requirements.txt

Dependencies:

🔧 Usage

Basic usage:

python subgapfix.py input.srt -o easyreading.srt

Options

Option Default Description
-o, --output subgapfix.srt Output SRT file
--extend-sub-start, -ess 0.5 Seconds to add to start of subtitle. Default is 0.5
--extend-sub-end, -ese 2.0 Maximum seconds to add to end of subtitle. Default is 2.0
--min-gap, -mg 1.0 Minimum gap (in seconds) required to apply extension. Default is 1.0

How It Works

The script reads your .srt file, loops through each pair of consecutive subtitles, and adjusts their timings to make them easier to read.

Example

Input:

1
00:00:01,000 --> 00:00:03,000
Hello there.

2
00:00:06,000 --> 00:00:08,000
How are you?

Run:

python subgapfix.py input.srt -o fixed.srt

Output:

1
00:00:01,000 --> 00:00:05,000
Hello there.

2
00:00:05,500 --> 00:00:08,000
How are you?

💡 Why?

Tools like WhisperX produce accurate subtitles, but their timings are often too tight for comfortable reading. SubGapFix helps subtitles stay visible longer while keeping synchronization intact.

🛠 Roadmap

  • Package for PyPI (pip install subgapfix)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

subgapfix-0.0.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

subgapfix-0.0.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file subgapfix-0.0.1.tar.gz.

File metadata

  • Download URL: subgapfix-0.0.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for subgapfix-0.0.1.tar.gz
Algorithm Hash digest
SHA256 476fa570ac2e02621403d701d8a5f95048464466e49adb7688549a8dd50e7268
MD5 d83b867277770dd10caea682885b2b9f
BLAKE2b-256 534d7fabe5c71e82082dc9e794cf12ae97af7a475ba0ee62df32ca9f55c7b017

See more details on using hashes here.

File details

Details for the file subgapfix-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: subgapfix-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for subgapfix-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a7d67f6319e46aeed640de3055cd849a8870952a1c365bae680679e707dc7f1e
MD5 428969769421830ebed5368fe5a04a8d
BLAKE2b-256 396136c00c5782300822faa3cd7bd0887ba80805d4b9be70b7c89adbeb255e99

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page