Sep 12, 2010

Automatically convert AVI to MP4

Posted by Knick

I have ordered my new Apple TV and while I wait the 3ish weeks for it to arrive I have been working to get my Movies library converted from AVI to a nice apple friendly MP4 format. I did a bunch of searching and exploring and found the best solution was to use the HandBrake Command Line Interface and run a batch process through the terminal on my entire movies directory and convert all my files without individual file interaction.

What the following process will do is scan the "source directory" for all AVI files and one by one re-encode them from AVI to MP4. This is a timely process but completely unmanaged as once you get the files in the proper source directory and start the batch process you can walk away.

I have started the batch on my AVI directory of 204 items and am waiting for the final results. The files that have been converted thus far have been perfect.

Follow the process below to run the script:

Download the HandbrakeCLI from here

Place the HandBrakeCLI file in the "Source Directory" where you have the movies you want to convert.

Create a new directory for the destination files to go

Copy and paste the following lines into a terminal window changing the source and destination directories to match your directory structure.

cd "$sourcedir"
for i in *.avi; do
./HandBrakeCLI -i "$i" -o "$destdir/${i%.*}.mp4" --preset="Normal"


Bom said...

thank you for sharing your experience. you may want to check this website, - it can convert avi to mp4.

Danny said...

hi man, I want to know is you are the friend of this guy, see he said in his webpage, , please I want too the hack to Halo, the aimbot, please, send to my email,

Flu said...

Thank You so much. I have been looking all over for something like this and its multi platform which is awesome.

Reed Amanda said...

I'd also recommend Acethinker Video Converter which I have used for many years. It is a free cloud based software to convert videos without installing anything in your device.

Post a Comment