Premise:
This is how to get turn your [insert video filename here] file into a 480xHHH (ie 480x272), h264 MP4 file that you can drag into iTunes and then sync onto your iP(hone/od Touch) and enjoy wherever you see fit.
Requirements:
1. An iP(hone/od Touch)
2. iTunes
There are only two other bits of software that you will need:
1. MPlayer Windows Binary [Source]
2. NicMP4Box [Windows Binary] [Source]
Assumptions:
I'm assuming you are running windows, if you're running *nix I assume you can compile the sources without any problems, and the steps are pretty similar, but I've not tried...
Pre-Instructions Instructions:
Extract MPlayer to somewhere simple, say c:\MPlayer, and pop the NicMP4Box.exe file in that directory too.
Actual Instructions:
Take a look at the next block of text:
This does 2 passes (higher quality, longer encoding time) of your input file and creates a 480x272 file with a 768k video bitrate (128k audio) in h264 format, in an mp4 container, and then does a magic trick to allow the file to be used with itunes.Code:SET input=*INPUT* SET output=*OUTPUT* SET final=*FINAL* SET width=*WIDTH* SET height=*HEIGHT* mencoder %input% -sws 9 -of lavf -lavfopts format=mp4 -vf scale=%width%:%height%,dsize=%width%:%height%,harddup -ovc x264 -x264encopts threads=auto:bitrate=768:vbv_maxrate=1500:vbv_bufsize=2000:nocabac:me=umh:trellis=1:level_idc=30:global_header:pass=1:turbo -oac faac -faacopts mpeg=4:object=2:br=160:raw -channels 2 -srate 48000 -o %output% mencoder %input% -sws 9 -of lavf -lavfopts format=mp4 -vf scale=%width%:%height%,dsize=%width%:%height%,harddup -ovc x264 -x264encopts threads=auto:bitrate=768:vbv_maxrate=1500:vbv_bufsize=2000:nocabac:me=umh:subq=6:frameref=6:trellis=1:level_idc=30:global_header:pass=2 -oac faac -faacopts mpeg=4:object=2:br=160:raw -channels 2 -srate 48000 -o %output% nicmp4box -add %output% %final%
*INPUT* -- This needs to be changed to the location of the input file, for example, if your avi file is called 'foo.avi' and its in the 'c:\bar' directory, this would be "c:\bar\foo.avi" (with quotes).
*OUTPUT* -- This needs to be changed to where you want your output file to go, along with the .MP4 file extension. example: "c:\output\foo_converted.mp4"
*FINAL* -- This needs to be changed to the 'final' name of the file, for example "c:\output\foo_complete.mp4"
*WIDTH* -- This should be set to 480, but you can change it if you really want. No quotes for this one.
*HEIGHT* -- This should be set by working out the aspect ratio of the original file (ie: original height/width * 480, if in doubt just use 272). No quotes here either.
Open up notepad, copy/paste that whole block of text in... Then change the *INPUT*, *OUTPUT*, *FINAL*, *WIDTH* and *HEIGHT* values, for example:
Leave the other 3 lines as they are.Code:SET input="c:\input\clunks_home_movie.avi" SET output="c:\output\clunks_home_movie-temp.mp4" SET final="c:\output\clunks_home_movie-final.mp4" SET width=480 SET height=272
Save it as "convert.bat" (need the quotes, otherwise it'll stick a .txt extension, and thats not very helpful), and stick it in your c:\MPlayer directory.
Next open a Command Prompt (Start->Run->CMD [ENTER]), and navigate to the MEncoder directory:
(assuming you extract it to c:\MPlayer)Code:cd \MPlayer [ENTER]
Then we want to run the bat file we just created:
...and sit back and let the magic happen. oh and the conversion supports smp, so will take advantage of dual/quadcode, so if you've got a superfast rig, you shouldn't have to wait too longCode:C:\MPlayer>convert [ENTER]
Once you have your final file, drag it into iTunes, plug in your iP(hone/od Touch) and then sync the movie. All done!
Credits:
James Hastings-Trew for this post about Nicmp4box and ipod atoms.
'Nic' for creating the nicmp4box program.
All the people who contribute(d) to MPlayer.


LinkBack URL
About LinkBacks

Reply With Quote
