Please see this question.

I have just merged two avi files cd1.avi and cd1.avi into movie.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:


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?


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


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

| improve this answer | |
  • +1 thanks micheal, really appreciate your efforts with my questions – Stefan Sep 20 '10 at 22:15
  • 1
    Thanks! 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. – user11667 Oct 19 '11 at 4:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.