[MEncoder-users] H264 encoding for PSP

James Hastings-Trew jimht at shaw.ca
Mon Sep 17 06:23:36 CEST 2007


RC wrote:
> x264 and Xvid do not act like lavc. Even though you're not specifying
> anything, a number of options are enabled by default (as noted in the
> man page). I don't have a PSP, but as per iPod encoding, I expect
> you'll at least need "nocabac", "level_idc" set pretty low (can't go
> wrong with 10). Perhaps also try "partitions=none".
I finally got this working for PSP (I've removed all the 2-pass stuff 
for brevity):

mencoder INPUT -sws 9 -vf scale=480:272,harddup,unsharp=l3x3:0.7 /
-oac faac -faacopts br=128:mpeg=4:object=2:raw /
-ovc x264 -x264encopts 
bitrate=650:global_header:partitions=all:trellis=1:vbv_maxrate=768:vbv_bufsize=2000:level_idc=30:threads=2 
/
-of lavf -lavfopts format=psp -ofps 24000/1001 -o OUTPUT

The file loads into and plays on the PSP perfectly.

I got this working for iPod:
mencoder INPUT -aid 128 -sws 9 -vf scale=640:-10,expand=640:480,harddup /
-oac faac -faacopts br=128:mpeg=4:object=2:raw /
-ovc x264 -x264encopts 
bitrate=900:vbv_maxrate=1500:vbv_bufsize=2000:nocabac:level_idc=13:global_header:threads=2 
/
-of lavf -lavfopts format=mp4 -ofps 24000/1001 -o OUTPUT

nicmp4box -add OUTPUT FINALFILE

The resulting file loads into iTunes and syncs with the iPod perfectly. 
However, unlike ASP encoded files which display properly on the ipod 
screen regardless of size, the AVC files tend to "zoom" in until they 
fill the screen, vertically, which means all the stuff on the ends are 
not displayed, hence the "expand" parameter in the video filters. That 
doesn't seem like correct behavior, so I fear there is some parameter 
missing from the file. When you do x264 encoding with ffmpeg one of the 
parameters you set is the aspect, but I've had a look through mencoder's 
x264encopts in the manual and don't see a way to specify this. Any ideas?




More information about the MEncoder-users mailing list