#!/usr/bin/perl -pl # time shift for srt subtitles BEGIN { ($dt = shift @ARGV) != 0 or print "Usage: $0 SECONDS file" and exit; } s{ (\d+) : (\d\d) : (\d\d) , (\d+) } { my @t = ($1, $2, $3, $4 + $dt * 1E3); $t[2] += $t[3] / 1E3; $t[3] %= 1E3; $t[1] += $t[2] / 60; $t[2] %= 60; $t[0] += $t[1] / 60; $t[1] %= 60; sprintf '%02d:%02d:%02d,%03d', @t; }gxe;
In reply to Time shift for SRT subtitles by ccn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |