Thursday, September 6, 2007

concatenate avi files

mencoder -oac copy -ovc copy -o output.avi input1.avi input2.avi

13 comments:

gerardjp.com said...

Sweet!! You saved me from installing and digging round in new software.

Thanx.

Gerard.

leo said...

You're welcome! Glad it was useful for someone else as well!

vk said...

Thanks! Just the command I was looking for.

Anonymous said...

Very helpful. I'd just finished using mencoder (!) to create two .avi files, but didn't know it could accept multiple inputs. I was resigned to having to go and install/learn a whole new program; now I don't have to. Thanks!

Anonymous said...

for multiple inputs try this:
1. change into the directory u have the files
2. mencoder -oac copy -ovc copy -o output.avi `ls input*.avi`
#you have to use backquotes!!

leo said...

Thanks, but wouldn't a simple
mencoder -oac copy -ovc copy -o output.avi input*.avi
also work for multiple files?

Anonymous said...

:) yes, you´re right, it´s simpler

Nuno said...

Very useful, thank you!

Anonymous said...

Awesome. Tried finding something this simple on Windows and then found this for Ubuntu. So easy and fast. Much appreciated.

Anonymous said...

index*.avi will not work if the list given by ls index*.avi is the order you want it given. If that is not the case neither method will work. In that case you use the backquotes
'ls index*.avi | sort'

This assumes sort actually sorts how you want which it happily will not for 99.999% of the stuff you want to get done.

You will have to play with sort and it's commands to know how it will sort.

There is a sort command built in to ls but it sucks more than sort does.

Later

hinschelwood said...

Thanks for posting this. It worked nicely for me and saved a lot of time looking through man pages!

Anonymous said...

If you join more than two files, the audio will become desinchronized with the video. The first minutes, everything is ok, but at the end, the error becomes greater.

Mousumi Choudhury said...

how to use mencoder with java