Sunday, June 22, 2008

ShiftSrt

ShiftSrt is a script I wrote to time shift video file subtitles stored in .srt format (see SubRip for .srt fomat examples).

My motivation for the script came when I downloaded a video with accompanying .srt subtitle file; and, I found the subtitles were out of sync with the video. Specifically, all of the subtitles were timed to display two and half seconds before the actual dialog occurred.

I first wrote the script in Python to brush up on my (limited) Python knowledge. I then ported it to Perl (same reasons).

Using the script is easy. Simply provide the following command line arguments (in order) when executing:
  1. path to the .srt file
  2. amount of time to shift by in milliseconds
Source (Python).
Source (Perl).

No comments: