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 <a title="See also Ubuntu - Install Screenlets" href="http://www.whileifblog.com/2010/11/07/ubuntu-install-screenlets/">install</a> mencoder mplayer
<a title="See also Ubuntu - Install Sun Java Packages" href="http://www.whileifblog.com/2010/11/03/ubuntu-install-sun-java-packages/">install</a> the appropriate <a title="See also Ubuntu - Change the date and time (or any other EXIF image meta-data)" href="http://www.whileifblog.com/2011/09/28/ubuntu-change-the-date-and-time-or-any-other-exif-image-meta-data/">software</a>
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.