Lengthen SubRip subtitles

I rented a Japanese DVD, and found the subtitles rather annoying. They weren't displayed for long enough, so I spent more of my attention trying to keep up with the subtitles and less time enjoying the movie.

I ripped the file to my harddisk, changed the subtitles to the well-known SubRip (srt) format using Avidemux, and wrote myself a tool to lengthen the subtitles.

The result is this program. It's written in Python (as most of my stuff is), and explains itself when you run

python lengthen.py --help

Of course, the subtitles are made as long as possible without actually overlapping with each other.

Usage

lengthen.py [-n <seconds>] [--input <infile>] [--output <outfile>]

Reads a subtitle file from <infile> (or stdin if not specified), and outputs a new subtitle file to <outfile> (or stdout if not specified). All subtitles in the new file will be displayed <seconds> longer than in the original file, but they won't be overlapping.

<seconds> can be either an integer or a floating point number.

The subtitle files should be in SRT format. You can use mplayer to convert different subtitle formats.