Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two *.avi files:


How do I merge these two files using a command-line or GUI?

share|improve this question
me curious why prefer ffmpeg? – Tshepang Dec 31 '10 at 7:32
ffmpeg is a very powerfull tool, so I thought it would be capable of merging two files together. However, as you can see from Micheal's answer we went with Avimerge. – Stefan Dec 31 '10 at 8:33
You can use ffmpeg command if you like (as it is not GUI I don't post it as answer) IIRC. – Maciej Piechotka Dec 31 '10 at 9:59
@Maciej You might post your answer here. – Tshepang Dec 31 '10 at 11:36
excuse me, but you still didn't tell me why ffmpeg – Tshepang Dec 31 '10 at 12:29
up vote 18 down vote accepted

There's a dedicated tool to do this, avimerge:

avimerge -o cd.avi -i cd1.avi cd2.avi
share|improve this answer
my distro (arch) doesn't have avimerge in the repositories.. – Stefan Sep 20 '10 at 15:21
@Stefan It appears to be part of transcode, if I'm reading this correctly – Michael Mrozek Sep 20 '10 at 15:34
thanks @micheal. – Stefan Dec 31 '10 at 8:31
Debian doesn't have transcode, supposedly due to patent issues. There's a third-party repo found at debian-multimedia.org, but the transcode package (version 1.1.5-0.7) doesn't have the avimerge binary. You might wanna make a note of that. – Tshepang Dec 31 '10 at 21:28
For Ubuntu, avimerge is available in the transcode-utils package from the multiverse repository. – jthetzel May 11 '12 at 16:50

Easy with mencoder (shipped with mplayer in Arch Linux):

$ mencoder -oac copy -ovc copy video1.avi video2.avi -o final.avi
share|improve this answer

Avidemux can paste two videos together, at least if they have the same resolution and a few other constraints. Use “Append” from the “File” menu.

share|improve this answer

You can merge avi files with avimerge from Transcode package:

avimerge -i file1.avi file2.avi -o output.avi

I know that it isn't GUI tool, but to have GUI you could use that script:

file1=`kdialog --getopenfilename ~/ \*.avi`
file2=`kdialog --getopenfilename ~/ \*.avi`
output=`kdialog --getsavefilename ~/ \*.avi`
avimerge -i $file1 $file2 -o $output

It uses kdialog so it's for KDE users, GNOME users should modify it to use Zenity...

share|improve this answer
Your thirst for going ahead and give the Answer regardless should have been quenched by going here: unix.stackexchange.com/questions/2273/…. Also, see my Comment on the Accepted Answer. – Tshepang Jan 2 '11 at 7:43
Oh, sorry - somehow I missed that question... – pbm Jan 2 '11 at 9:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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