PDA

View Full Version : HOWTO :: Convert AVI to MP4 to be viewable on an iPhone


royong
22-01-2009, 15:09
Got myself an iPhone recently and was wondering how to get a full AVI onto the iPhone so that we can use the VLCiPhone to view.

Worked at it for a while and finally got it to work. We will need your Linux machine to have VLC installed. If you don't have that installed, probably something like "yum install vlc" should be sufficient. In any case, VLC installation for your distribution should be well-documented - hence a quick jump to Google should be sufficient to get you installed. In any case, if you have any problems, please feel free to post.

Step 01: Presuming that you have got VLC installed.

Step 02: Save the following bash script as something say convert.sh in the same directory as your source files
#!/bin/bash
OUT=`echo $1 |sed -e 's/\.avi/.mp4/i'`
vlc "$1" vlc:quit -v --no-show-intf --sout "#transcode{fps=25, width=320, height=240, canvas-aspect=1.5:1, vcodec=mp4v, vb=384, acodec=mp4a, ab=96,channels=1,audio-sync}:duplicate{dst=std{access=file,mux=mp4,dst=$O UT}}"

Step 03: If your original filename is S01E01.AVI, then can you run the following
$ sh ./convert.sh S01E01.AVI

The result will be S01E01.MP4 - copy this to your iPhoto and you should be able to view it using VLCiPhone :P