Encoding iPod touch/iPhone/PSP video from CLI

These goddamn video players a.k.a. ipod/iphone/psp wont play .avi straight from the box.
They need to be converted to some stupid mp4 format to get played.
Now usually ppl use some stupid windows/mac GUI tool to do all of this, and then letting their computer grind these jobs.
We have a solution for your server/linuxbox/whatever:

Lets say you have a directory of .avi files you want to convert to .mp4 format, we use ffmpeg and a for loop to do this:
To setup ffmpeg you gotta solve that yourself. Here is a tip if you use ubuntu:
http://juliensimon.blogspot.com/2008/12/howto-compiling-ffmpeg-x264-mp3-xvid.html

iPod Touch/iPhone:for i in *.avi;do ffmpeg -i $i input -acodec aac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s 320x180 -title X $i.mp4;done

PSP:for i in *.avi;do ffmpeg -i $i -b 300 -s 320x240 -vcodec xvid -ab 32 -ar 24000 -acodec aac $i.mp4;done

Tags: , , , , , ,