Created
September 9, 2018 22:26
-
-
Save ara4n/71df14d9112ac8c94613ae56bedc3e07 to your computer and use it in GitHub Desktop.
Shifting subtitle timings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Moving subtitles 4 seconds into the future: | |
cat subs.txt | perl -ne 'sub fix { $t=$_[0]*60*1000 + $_[1]*1000 + $_[2]; $t+=4000; return sprintf("%02d:%02d.%03d", int($t/(60*1000)), int($t/1000) % 60, $t % 1000); } if (/^0:(..):(..).(...),0:(..):(..).(...)$/) { $a=fix($1,$2,$3); $b=fix($4,$5,$6); print "0:$a,0:$b\n" } else { print $_ }' > subs2.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment