[MEncoder-users] Encoding H.264 for iPod Touch?

James Hastings-Trew jimht at shaw.ca
Sat Dec 8 16:48:34 CET 2007


Fredrik Roubert wrote:
> Hi!
>
> I'm using MEncoder (1.0rc2) to encode videos for my iPod Touch. The
> following command line produces files that work perfectly fine:
>
> mencoder -ofps 25 -of lavf -lavfopts format=mp4 -af lavcresample=44100 -vf-add harddup -vf-add scale=480:-11 -oac lavc -ovc lavc -lavcopts aglobal=1:vglobal=1:acodec=libfaac:abitrate=128:vcodec=mpeg4:vbitrate=384:keyint=25 -o test.mp4 test.avi
>
> I do however believe that I could get improved quality by encoding in
> H.264 instead, and did the following obvious attempt:
>
> mencoder -ofps 25 -of lavf -lavfopts format=mp4 -af lavcresample=44100 -vf-add harddup -vf-add scale=480:-11 -oac lavc -ovc lavc -lavcopts aglobal=1:vglobal=1:acodec=libfaac:abitrate=128:vcodec=libx264:vbitrate=384:keyint=25 -o test.mp4 test.avi
>
> The files produced by that command line play fine in MPlayer and
> QuickTime Player but iTunes refuses to download them to the iPod.
>
> Does anyone know anything useful to help me out here?
>   
iTunes won't download them to the ipod unless the "itunes" atom is set 
to the correct value. You can add the atom to the file with nicMP4Box ( 
http://nic.dnsalias.com/NicMP4Box.zip )

nicmp4box -add test.mp4 final.mp4

I've posted my own personal recipe for ipod encoding on the list before, but here it is again:

mencoder INPUT -sws 9 -of lavf -lavfopts format=mp4
/ -vf scale=576:320,dsize=576:320,harddup
/ -ovc x264
/ -x264encopts bitrate=1381:vbv_maxrate=1500:vbv_bufsize=2000:nocabac:me=umh:
/trellis=1:level_idc=30:global_header:threads=2:pass=1:turbo
/ -oac faac
/ -faacopts mpeg=4:object=2:br=160:raw -channels 2 -srate 48000 -o TEMP.mp4

mencoder INPUT -sws 9 -of lavf -lavfopts format=mp4
/ -vf scale=576:320,dsize=576:320,harddup
/ -ovc x264
/ -x264encopts bitrate=1381:vbv_maxrate=1500:vbv_bufsize=2000:nocabac:me=umh:
/subq=6:frameref=6:trellis=1:level_idc=30:global_header:threads=2:pass=2
/ -oac faac
/ -faacopts mpeg=4:object=2:br=160:raw -channels 2 -srate 48000 -o TEMP.mp4

nicmp4box -add TEMP.mp4 OUTPUT.mp4






More information about the MEncoder-users mailing list