LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to merge 2 avi together? (https://www.linuxquestions.org/questions/linux-general-1/how-to-merge-2-avi-together-424988/)

kornerr 03-15-2006 04:28 AM

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.

nx5000 03-15-2006 04:53 AM

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.

Pyrate_02 03-16-2006 01:57 AM

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.

reddazz 03-16-2006 02:24 AM

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.

osio 04-25-2006 03:12 PM

An example of a succesful join:
$ mencoder -ovc lavc start.avi end.avi -o complete.avi

Emerson 04-25-2006 03:39 PM

Avidemux does it with ease and even rebuilds missing frames (smart copy).

linux_terror 05-17-2007 01:21 AM

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.

walkingman 05-18-2007 08:55 AM

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.

htamayo 12-02-2008 10:14 AM

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

Donlok 12-15-2010 07:19 AM

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

htamayo 12-15-2010 09:21 AM

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

htamayo 12-15-2010 09:21 AM

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


All times are GMT -5. The time now is 02:31 PM.