Posted in Linux

How to Join 2 avi files….

Post borrowed from Linux Clues

It is usual having an avi film split into two cdrom sized files of 700 megabytes each.

mencoder utility allows us to concatenate these two parts into a new reintegrate file.

mencoder (MPlayer’s Movie Encoder) is a tool MPlayer provides to encode multimedia contents into files.
It supports among others, MPEG-4 video, libavcodec codecs, and PCM/MP3/VBRMP3 audio formats.
mencoder also possesses stream copying abilities and a powerful filter system (crop, expand, flip, ….).

So we have a film split into two files e.g: foo1.avi and foo2.avi, both with the same encoding characteristics (window size, codecs, bitrate…),

We execute this command that produces an output file called foo.avi which is the result of concatenating foo1.avi and foo2.avi files.
$mencoder -oac copy -ovc copy -forceidx foo1.avi foo2.avi -o foo.avi

The command options mean:
* -oac output audio codec
* -ovc output video codec
* -o output file name
* -forceidx forces creation of a new index.
copy means copying the original stream and do not change the codec it is encoded into (because of that it is very fast).

more info executing: $man mencoder


  • Ubuntu and Debian: $sudo aptitude install mencoder


I am and have been an Oracle dba for the past twenty something years, with a few deviations to dabble in other areas. I’m certified (or is that certifiable) in both Oracle 10 and 11G OCP. I’m an “old skool” hacker at heart in the traditional sense, pulling apart bits of kit to see how they work, mainly with the intention of fixing it, mostly with the outcome of breaking it! I like toying with hardware, software and new technologies and love Linux, although Windows 10 is looking pretty slick too. I have a keen interest in reading / writing and electronics, and occasionally snap a few photos. If I can help you I will, so if you have any questions feel free to ask by using my contact form. -Lee And now for the disclaimer: Anything I write here is my own opinion and does not represent the view of any company I work for now or have worked for in the past.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.