[MEncoder-users] Script for h264 conversion for mencoder

James Hastings-Trew jimht at shaw.ca
Sun Jan 20 17:34:26 CET 2008


Cameron Just wrote:
> Hi,
>
> I have been trying and searching for the last two months to try and get 
> mencoder to encode a file in the h264 format that works within the 
> xbox360 media player but just can't seem to get it to work.
>
> I have googled and found something close in this list however I can't 
> seem to contact the people who found a solution using ffmpeg
> http://lists.mplayerhq.hu/pipermail/mencoder-users/2007-May/005957.html
>
> This is the current script I am using but it just wont play on the 360
>
> mencoder.exe input.avi -o NUL -passlogfile "2pass.log" -nosound -ovc 
> x264 -x264encopts 
> subq=4:bframes=4:b_pyramid:weight_b:pass=1:psnr:bitrate=350:turbo=1
>
> mencoder.exe "input.avi" -o "output.mp4" -aspect 16:9 -passlogfile 
> "2pass.log"  -oac lavc -lavcopts acodec=ac3:abitrate=192 -ovc x264 
> -x264encopts 
> subq=5:4x4mv:8x8dct:frameref=3:me=2:bframes=4:b_pyramid:pass=2:psnr:bitrate=350 
> -vf crop=392:568:70:3,scale=392:296
>   
A few things. Your scale is wrong - the dimensions have to be divisible 
by 16. 392x296 isn't. 400x304 is. Then you have to use the dsize video 
filter to set the pixel aspect ratio to 1:1. Your bitrate is very very 
low - try at least 900 for that size of video. Also, from what I can 
tell you are making an AVI file and calling it .mp4. You'll need to 
specify the format container. But then you won't be able to use 
b-frames, at all. So try this as a starting point:

mencoder INPUT -sws 9 -of lavf -lavfopts format=mp4 -vf 
crop=392:568:70:3,scale=400:304,dsize=400:304,harddup -ovc x264 
-x264encopts 
bitrate=900:vbv_maxrate=1500:vbv_bufsize=1835:nocabac:me=umh:trellis=1:level_idc=41:global_header:threads=auto 
-oac faac -faacopts mpeg=4:object=2:br=160:raw -channels 2 -srate 48000 
-o output.mp4




More information about the MEncoder-users mailing list