How do I merge two *.srt files
This is pretty trivially done, since .srt
files are just text files that contain time stamps -- all you need to do is add the length of cd1.avi
to the times of all the subtitles in cd2.srt
. You can find the length of cd1.avi
with ffmpeg
:
ffmpeg -i cd1.avi # Look for the Duration: line
And then add that to cd2.srt
using srttool
srttool -d 12345 -i cd2.srt # 12345 is the amount to add in seconds
or:
srttool -a hh:mm:ss -i cd2.srt # The first subtitle will now start at hh:mm:ss
Then you should just be able to concatenate the files together and renumber:
srttool -r -i cd.srt
I picked srttool
because in Arch it comes with transcode
, which you installed for this question; there are lots of other tools that can shift and merge .srt
files too, and at least one website, submerge
Related videos on Youtube
Comments
-
Stefan almost 2 years
Please see this question.
I have just merged two avi files
cd1.avi
andcd1.avi
intomovie.avi
using:avimerge -o movie.avi -i cd{1,2}.avi
Problem is that I had to subtitle files linked to the first
avi
files:cd1.srt cd2.srt
At first I tried simply to concatenate the files together:
cat cd{1,2}.srt > movie.srt
But that caused havoc with the subtitles... any suggestions?
-
Stefan almost 14 years+1 thanks micheal, really appreciate your efforts with my questions
-
Jeremy over 12 yearsThanks! This worked great. Only problem I found is that srttool puts output to the command line. I actually doesn't modify the file you want. A little redirection (>) and WHAMMO, it works perfectly. This has been a huge help and thank you very much.
-
Konrad Szałwiński almost 4 yearsHow do you install srttool on MacOS?