How to correct/shift subtitle time forward and backward? Subtitle time format looks like this:
00:00:52,656 --> 00:00:56,326
If subtitle and audio aren’t synchronized, for example, subtitle shows up before voice/audio, then all times of subtitle lines (time format: 00:00:52,656 --> 00:00:56,326) should be corrected.
So, if time of all subtitle lines must be changed/shifted for 2 sec. forward, then, this time for subtitle line: 00:00:52,656 --> 00:00:56,326 should be changed to:
00:00:54,656 --> 00:00:58,326.
And this refers to all times in the subtitle file, not just one line of text/one time.
Example of how SubRip (.srt) file looks like:
1
00:00:52,656 --> 00:00:56,326
Kanalska Zona: Panama
2
00:00:56,335 --> 00:00:59,755
Francuzi su pokušali da izgrade
kanal pre Amerikanaca.
Providing that the format of each line in your input is always
00:00:00,000 --> 00:00:00,000, then this routine will convert the string times toTDateTime, add or subtract the shift, and rewrite the line:Edit:
Due to your edit, now input may contain ‘wrong’ lines that need no conversion too.