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

Install from PyPI:

pip install subgapfix

Dependencies used:

🔧 Usage

Basic usage:

subgapfix 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 lengthens their timings (if applicable) 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:

subgapfix input.srt -o easyreading.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.

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.2.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.2-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: subgapfix-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 86bc65e350130f3493445ad886b2334671938e493f170a5ef80720f711a3070f
MD5 5eaff558ec4707ef2e1fbf66081e2d79
BLAKE2b-256 28dc2aa06d4a9a4973229f68f7726bc16554089ebbc8c18c798a77a280d610b0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: subgapfix-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.4 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a27e55ff23a2d25c9101ab7422e2469a6ea943205010fb89d1912e274a2ee4ac
MD5 548a6d088ee16ca236ec7cd85fba8dcc
BLAKE2b-256 2069e5f802e53001d5a3ab3f78aff944937d3c652b8901ab38b308e40162a924

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