Ubuntu – Merge avi (mpg or mpeg) files

We will merge the files using cat and mencoder. For that purpose we will first install the appropriate software to use mencoder, then we will concatenate our files and last we will repair some out-of-sync due to the concatenation.
We need to do the following:

   1. sudo apt-get install mencoder mplayer 
       install the appropriate software
   2. cat file1.avi file2.avi ...filen.avi > file.avi 
       we are concatenating files 1 to n
   3. mencoder -forceidx -oac copy -ovc copy file.avi -o file_final.avi
      to repair some possible break in sync between video and sound due to cat command.

Leave a Reply

Your email address will not be published. Required fields are marked *