LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-15-2006, 04:28 AM   #1
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
How to merge 2 avi together?


I have two avi parts of a film. I want to merge them to make one file.
But cat *.avi > complete.avi gives me just trash. If I just cat pt1.avi > complete.avi, complete.avi is fine, but when I cat pt2.avi >> complete.avi I get trash too.
How to fix it?

Thanks.
 
Old 03-15-2006, 04:53 AM   #2
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 55
You can't do this, because I guess you broke the format of the file. example if in each avi the size is stored in the first bytes then putting 1.avi next to 2.avi will not work as the header is still the one of 1.avi.

You need avimerge. A lot of others tool might do this.
 
Old 03-16-2006, 01:57 AM   #3
Pyrate_02
LQ Newbie
 
Registered: Mar 2006
Location: Salem, OR
Distribution: Mandriva
Posts: 9

Rep: Reputation: 0
Had the same exact problem. I'm recording AVIs with lavrec, and couldn't merge them. I finally used ffmpeg to convert avi to mpg, then
cat 1.mpg 2.mpg worked perfect. The mpgs are a little smaller, too. Good workaround, unless you absolutly have to have AVI format.
 
Old 03-16-2006, 02:24 AM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 75
You can use mencoder or trancode to merge avi files. There are gui apps such as Konverter that nake the process easier using a gui.
 
Old 04-25-2006, 03:12 PM   #5
osio
Member
 
Registered: Jun 2005
Posts: 70

Rep: Reputation: 15
An example of a succesful join:
$ mencoder -ovc lavc start.avi end.avi -o complete.avi
 
Old 04-25-2006, 03:39 PM   #6
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 5,959

Rep: Reputation: Disabled
Avidemux does it with ease and even rebuilds missing frames (smart copy).
 
Old 05-17-2007, 01:21 AM   #7
linux_terror
Member
 
Registered: Aug 2004
Location: Northbrook, Illinois
Distribution: CentOS-5
Posts: 311

Rep: Reputation: 30
mencoder -oac copy -ovc copy part1.avi part2.avi part3.avi -o WHOLE-THING.avi


avimerge is another simple tool for this but i've run into audio sync problems using it, the mencoder method seems to not have this issue.
 
Old 05-18-2007, 08:55 AM   #8
walkingman
LQ Newbie
 
Registered: Aug 2006
Posts: 6

Rep: Reputation: 0
It depends

Since avi is a container and not a codec it depends if one can use the cat method. It can be used with dv avi files. Also with mpg and vob files. But if you are using the cat method you should also use the mencoder with -forceidx on the end file to rebuild broken index.
 
Old 12-02-2008, 10:14 AM   #9
htamayo
Member
 
Registered: Jan 2005
Location: san salvador, el salvador
Distribution: Debian Stable, UbuntuStudio Karmic Koala
Posts: 190

Rep: Reputation: 30
avimerge is also a good option

Hi, I had the same need, to join several chunk of several videos into one single piece. I tried the commands you mentioned but the result was:

1. avidemux couldn't do it, in fact, I used avidemux to edit the videos and extract the chunks, but when I tried to attached all junks in one single always got the message " master index wrong, rebuild?" then I rebuild it but it was the same, I couldn't merge them.

2. mencoder gave me some errors, maybe because I think this command tried to recode the chunks and then merge them, in fact, I've used the same codecs for video and audio but still I can't get it.

The command that worked for me was: avimerge, it just joins all my chunks in one single, the line is:

avimerge -o bigone.avi -i chunk1.avi chunk2.avi chunk3.avi


I hope it's usefull

Regards

Tamayo
 
Old 12-15-2010, 07:19 AM   #10
Donlok
LQ Newbie
 
Registered: Dec 2010
Posts: 2

Rep: Reputation: 0
AVIMerge

Hey thank you for the line to combine chunks of avi files together it worked great with AVIMERGE and it was really fast, only took a few minutes, and I merged 5 files into one. Perfect video, nothing changed, except it converted the 5 chunks into one movie.

Thank you again for your blood sweat and tears, saved me several minutes, and having to go back to Winders to finalize.

Donlok
 
Old 12-15-2010, 09:21 AM   #11
htamayo
Member
 
Registered: Jan 2005
Location: san salvador, el salvador
Distribution: Debian Stable, UbuntuStudio Karmic Koala
Posts: 190

Rep: Reputation: 30
Your welcome, as a comment, I was working in a 3D project - using blender of course- and I found several problems with the video editing, I found that the problem was the codec - first I use AVI Raw - that was all the issue, I change to mpeg, render all again and the video editing was really easy, but you know, I wrote this because when you're in a hurry to finish the work and something doesn't work you think in a lot of things, in this case, the codec was important.

regards

htamayo
 
Old 12-15-2010, 09:21 AM   #12
htamayo
Member
 
Registered: Jan 2005
Location: san salvador, el salvador
Distribution: Debian Stable, UbuntuStudio Karmic Koala
Posts: 190

Rep: Reputation: 30
Your welcome, as a comment, I was working in a 3D project - using blender of course- and I found several problems with the video editing, I found that the problem was the codec - first I use AVI Raw - that was all the issue, I change to mpeg, render all again and the video editing was really easy, but you know, I wrote this because when you're in a hurry to finish the work and something doesn't work you think in a lot of things, in this case, the codec was important.

regards

htamayo
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
merge directories d-fens Linux - General 9 02-04-2010 05:48 PM
change uploaded files from filename.avi to filename.avi.html like www.rapidshare.de latheesan Linux - Newbie 3 06-16-2005 04:33 AM
merge mailboxes illtbagu Linux - Software 0 03-13-2004 01:53 PM
Converting avi to mpg OR creating an SVCD from an avi MasterC Linux - Software 5 03-28-2003 05:42 AM
[AVI, mencoder, merge files] MrGreg Linux - Software 5 01-02-2003 05:46 AM


All times are GMT -5. The time now is 12:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration