[MEncoder-users] OCD formatting of DVDs for iPhone

James Hastings-Trew jimht at shaw.ca
Sun Jan 25 14:18:49 CET 2009


Peter Sebastian Masny wrote:
> Hi all,
>
> [[[[in short, take 16:9 input and make the video 480x270, then add black 
> bars above and below to real resolution 480x320, with a 1:1 pixel ratio]]]]
>
> Longer:
> I got a command line that does a good job of converting a DVD folder 
> into an MPEG4 for my iPhone. The only problem is the aspect ratio. The 
> situation:
> 1. my movies are all 16:9 (1.77:1)
> 2. mencoder rarely accurately detects the original aspect ratio (I seem 
> to get 2.37:1 all the time)
> 3. iPhone display is 480x320 (1.5:1)
> 4. quicktime and iPhone need 1:1 pixel sizes, but iPhone will resize the 
> pixel ratio (that's the weird part)
>
> I can run dsize=480:270  and get a nice video, playable on my iPhone, 
> but when played it gets stretched to fill the screen (480x320)
>
> This bothers my OCD tendencies.
>
> I've tried to force the iPhone to add black bars to the top and bottom by
> dsize=480:270,expand=480:320, but this makes SAR 32/27 and does not add 
> real black bars.
> What's the correct incantation to in short, take 16:9 input and make the 
> video 480x270, then add black bars above and below to 480x320, with a 
> 1:1 pixel ratio?
>   
Expand, then dsize. when the dsize matches the pixel size of the frame, 
then the SAR is 1/1.

BUT, you don't need to add the black bars at all. the iPhone supports a 
480:270 size video just fine. Just make sure the dsize is the same as 
scale size. 480:320 is it's "4:3" resolution, and 480:270 is it's "16:9" 
resolution.

As for mencoder detecting the aspect ratio properly, DVDs only have two 
aspect ratios - full screen (4:3) or wide (16:9). Anything wider than 
16:9 is encoded at the 16:9 aspect, with black bars added. Further 
complicating the issue, some lower quality DVDs have "wide screen" 
movies encoded in a 4:3 frame with black bars added. However, all DVDs 
have the same size frame - 720x480 (or 720 x 576 for PAL). You can 
ignore input aspect ratio altogether by specifying your crop, scale, and 
dsize parameters and mencoder will spit out whatever you want.



More information about the MEncoder-users mailing list