27 second delay?! I would think your subs would be set up for that!
a (no login) Posted May 27, 2012 7:33 AM
You could also just use VLC's built-in sub delay feature... You can find it in the advanced preferences under Input / Codecs => Demuxers => Subtitles. You can also run the movie from the command line:
vlc --sub-delay <integer> <filename>
I'm fairly certain the integer specifying the delay is the number of milliseconds (multiply the number of seconds by 1000) because if it was the number of seconds, the subtitles might seem slightly off.
In any case, here's a program to do it. I designed it to run from the command line because typing a long SRT file name is far too prone to error and renaming isn't always an option when you just want to play the movie. Therefore, this program should be run compiled rather than interpreted. This also assumes a well-formed SRT file that follows the format
<sub startTime> --> <sub endTime>
<text> (one or more lines)
so no error checking is done in that regard. Here's the program that is completely untested and not spell-checked:
hrs AS INTEGER
mins AS INTEGER
secs AS INTEGER
msecs AS INTEGER
DIM amount AS srtTime, amountString$
DIM fi AS INTEGER, fo AS INTEGER
DIM fromVal AS srtTime, toVal AS srtTime
DIM i AS LONG
IF LEN(COMMAND$) < 2 THEN
PRINT "usage: srtdelay.exe millisec_delay FILE..."
PRINT " 20 second delay for all files listed:"
PRINT " srtdelay.exe 20000 file1.srt file2.srt file3.srt"
PRINT " 500 millisecond delay for the files listed:"
PRINT " srtdelay.exe 500 file1.srt file2.srt file3.srt"