Jan
13
2009

Join or merge many avi files with AviMerge in Ubuntu

If you have a movie which is in many parts,you can join them to make one file using the avimerge command in Ubuntu.
You need to install the transcode package to use the avimerge tool
to Install Transcode

<strong>sudo apt-get install transcode </strong>

at Terminal

To merge avi files use the avimerge command.

<strong>avimerge -i part1.avi part2.avi -o mergedavifile.avi</strong>

The above command merges part1.avi and part2.avi into a single file called mergedavifile.avi
The following video will make things clear.

In this video I am joining the parts of the movie 1920.

[ad]

«

»

About the Author: Bharat Balegere

Bharat Balegere is a 27 year old blogger from Bengaluru. He is a technology enthusiast and loves tinkering with computers and usb drives.

5 Comments + Add Comment

  • Thanks! I have been looking at different programs, but this command is insanely fast and simple. Thanks a lot!!! :D

  • I had 5 Files to Join in a Temp folder..
    The joined OK, but voice Sync was off in the middle
    All my J*.avi files played perfect before and after the process, Only the ‘New creation’ was faulty.
    This command string did NOT work for me.
    This was my process

    J@u804:~/temp$ ls
    J1.avi J2.avi J3.avi J4.avi J5.avi
    J@u804:~/temp$ avimerge -i J1.avi J2.avi J3.avi J4.avi J5.avi -o file.avi
    scanning file J1.avi for video/audio parameter
    [avilib] V: 29.970 fps, codec=DIVX, frames=61506, width=720, height=480
    [avilib] A: 48000 Hz, format=0x55, bits=0, channels=2, bitrate=128 kbps,
    [avilib] 85519 chunks, 32839296 bytes, VBR
    merging multiple AVI-files (concatenating) …
    file 01 J1.avi
    [J1.avi] (000000-061505) (2052250.20 2052264.00)
    file 02 J2.avi
    [J2.avi] (061506-164808) (2749563.48 2749584.00)
    file 03 J3.avi
    [J3.avi] (164809-164809) (5499160.33 4621200.00)
    No audiodata left for track 0->0 (4621200.00=4621200.00) continuing ..
    [J3.avi] (164809-220899) (7370696.67 4621200.00)
    file 04 J4.avi
    [J4.avi] (220900-220900) (7370730.03 6390024.00)
    No audiodata left for track 0->0 (6390024.00=6390024.00) continuing ..
    [J4.avi] (220900-273905) (9139330.20 6390024.00)
    file 05 J5.avi
    [J5.avi] (273906-313062) (5222934.38 6390024.00)
    … done merging 5 file(s) in file.avi
    [avilib] V: 29.970 fps, codec=DIVX, frames=313063, width=720, height=480
    [avilib] A: 48000 Hz, format=0x55, bits=0, channels=2, bitrate=128 kbps,
    [avilib] 266251 chunks, 102240384 bytes, VBR
    scanning file J1.avi for video/audio parameter
    [avilib] V: 29.970 fps, codec=DIVX, frames=61506, width=720, height=480
    [avilib] A: 48000 Hz, format=0x55, bits=0, channels=2, bitrate=128 kbps,
    [avilib] 85519 chunks, 32839296 bytes, VBR
    merging multiple AVI-files (concatenating) …
    file 01 J1.avi
    [J1.avi] (000000-061505) (2052250.20 2052264.00)
    file 02 J2.avi
    [J2.avi] (061506-164808) (2749563.48 2749584.00)
    file 03 J3.avi
    [J3.avi] (164809-164809) (5499160.33 4621200.00)
    No audiodata left for track 0->0 (4621200.00=4621200.00) continuing ..
    [J3.avi] (164809-220899) (7370696.67 4621200.00)
    file 04 J4.avi
    [J4.avi] (220900-220900) (7370730.03 6390024.00)
    No audiodata left for track 0->0 (6390024.00=6390024.00) continuing ..
    [J4.avi] (220900-273905) (9139330.20 6390024.00)
    file 05 J5.avi
    [J5.avi] (273906-313062) (5222934.38 6390024.00)
    … done merging 5 file(s) in file.avi
    [avilib] V: 29.970 fps, codec=DIVX, frames=313063, width=720, height=480
    [avilib] A: 48000 Hz, format=0x55, bits=0, channels=2, bitrate=128 kbps,
    [avilib] 266251 chunks, 102240384 bytes, VBR
    scanning file J1.avi for video/audio parameter
    [avilib] V: 29.970 fps, codec=DIVX, frames=61506, width=720, height=480
    [avilib] A: 48000 Hz, format=0x55, bits=0, channels=2, bitrate=128 kbps,
    [avilib] 85519 chunks, 32839296 bytes, VBR
    merging multiple AVI-files (concatenating) …
    file 01 J1.avi
    [J1.avi] (000000-061505) (2052250.20 2052264.00)
    file 02 J2.avi
    [J2.avi] (061506-164808) (2749563.48 2749584.00)
    file 03 J3.avi
    [J3.avi] (164809-164809) (5499160.33 4621200.00)
    No audiodata left for track 0->0 (4621200.00=4621200.00) continuing ..
    [J3.avi] (164809-220899) (7370696.67 4621200.00)
    file 04 J4.avi
    [J4.avi] (220900-220900) (7370730.03 6390024.00)
    No audiodata left for track 0->0 (6390024.00=6390024.00) continuing ..
    [J4.avi] (220900-273905) (9139330.20 6390024.00)
    file 05 J5.avi
    [J5.avi] (273906-313062) (5222934.38 6390024.00)
    … done merging 5 file(s) in file.avi
    [avilib] V: 29.970 fps, codec=DIVX, frames=313063, width=720, height=480
    [avilib] A: 48000 Hz, format=0x55, bits=0, channels=2, bitrate=128 kbps,
    [avilib] 266251 chunks, 102240384 bytes, VBR
    scanning file J1.avi for video/audio parameter
    [avilib] V: 29.970 fps, codec=DIVX, frames=61506, width=720, height=480
    [avilib] A: 48000 Hz, format=0x55, bits=0, channels=2, bitrate=128 kbps,
    [avilib] 85519 chunks, 32839296 bytes, VBR
    merging multiple AVI-files (concatenating) …
    file 01 J1.avi
    [J1.avi] (000000-061505) (2052250.20 2052264.00)
    file 02 J2.avi
    [J2.avi] (061506-164808) (2749563.48 2749584.00)
    file 03 J3.avi
    [J3.avi] (164809-164809) (5499160.33 4621200.00)
    No audiodata left for track 0->0 (4621200.00=4621200.00) continuing ..
    [J3.avi] (164809-220899) (7370696.67 4621200.00)
    file 04 J4.avi
    [J4.avi] (220900-220900) (7370730.03 6390024.00)
    No audiodata left for track 0->0 (6390024.00=6390024.00) continuing ..
    [J4.avi] (220900-273905) (9139330.20 6390024.00)
    file 05 J5.avi
    [J5.avi] (273906-313062) (5222934.38 6390024.00)
    … done merging 5 file(s) in file.avi
    [avilib] V: 29.970 fps, codec=DIVX, frames=313063, width=720, height=480
    [avilib] A: 48000 Hz, format=0x55, bits=0, channels=2, bitrate=128 kbps,
    [avilib] 266251 chunks, 102240384 bytes, VBR
    J@u804:~/temp$
    J@u804:~/temp$ ls
    file.avi J1.avi J2.avi J3.avi J4.avi J5.avi

    The resulting ‘file.avi’ has faulty sound.

  • Try running it with the following options, and it may fix your audio issues:

    avimerge -c -i J1.avi J2.avi J3.avi J4.avi J5.avi -o file.avi

  • mencoder -ovc copy -oac copy file1.avi file2.avi -o combined.avi

    Doh!

    AviMerge trashes the sound on most systems. The -c fix is no solution. Then, I try to add an additional audio track with the -p option. “No video stream”. What an odd thing to be missing from an additional audio track. Skip it. This program is a waste.

    Here’s a good Ubuntu solution. What’s the answer always come down to? Mencoder/mplayer. Why? It’s done 1/2 professional. What a concept. And what kind of person would try to promote a second rate substitute? Ignorant or doesn’t give a damn about your prob/time. A groid, in other words. You know, when you’re in a form like this and someone uses “issues”… It’s like an apartment rating when a supposed typical resident says “appointed” or “amenities”. Real people don’t talk like that. That’s marketing fraud. Again, is the person to ignorant to know the diff or pimping you? Either way, why listen?

    mencoder -ovc copy -oac copy file1.avi file2.avi -o combined.avi

    Now think of the time you’ve wasted. That’s what gets the groidy groids rocks’ off.

  • As for me, using commands to merge avi files is too complex. I prefer to use some professional video joiners. I used Joyoshare Video Joiner before. I have merged videos for 5 free times then I need to pay for it. But I don’t want to, then I sought another free tool – Clideo. It is an online tool the merge speed is too slow. Compared to spending money, I am willing to wait for more time to merge.

Leave a comment