[MEncoder-users] OCD formatting of DVDs for iPhone

Peter Sebastian Masny ps-list at masny.dk
Sun Jan 25 02:02:47 CET 2009


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?

Thanks in advance,
Peter

Output:
> $ mencoder dvd://1 -dvd-device ANOMALY/ -o ANOMALY.mp4 -of lavf 
> -lavfopts format=mp4 \
> > -vf pp=ci,dsize=480:270,expand=480:320,harddup -sws 9 \
> > -ovc x264 -x264encopts 
> nocabac:level_idc=30:bframes=0:global_header:threads=auto:subq=5:frameref=6:partitions=all:trellis=1:chroma_me:me=umh:bitrate=512 
> \
> > -oac faac -faacopts mpeg=4:object=2:raw:br=192
> MEncoder dev-SVN-r26940 (C) 2000-2008 MPlayer Team
> CPU: Intel(R) Pentium(R) D CPU 2.80GHz (Family: 15, Model: 4, Stepping: 4)
> CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
> Compiled with runtime CPU detection.
> There are 53 titles on this DVD.
> There are 1 angles in this DVD title.
> audio stream: 0 format: ac3 (stereo) language: en aid: 128.
> number of audio channels on disk: 1.
> number of subtitles on disk: 0
> success: format: 2  data: 0x0 - 0xc69b0000
> MPEG-PS file format detected.
> VIDEO:  MPEG2  720x480  (aspect 3)  29.970 fps  6500.0 kbps (812.5 
> kbyte/s)
> [V] filefmt:2  fourcc:0x10000002  size:720x480  fps:29.970  ftime:=0.0334
> ==========================================================================
> Opening audio decoder: [liba52] AC3 decoding with liba52
> Using SSE optimized IMDCT transform
> Using MMX optimized resampler
> AUDIO: 48000 Hz, 2 ch, s16le, 192.0 kbit/12.50% (ratio: 24000->192000)
> Selected audio codec: [a52] afm: liba52 (AC3-liba52)
> ==========================================================================
> ** MUXER_LAVF 
> *****************************************************************
> REMEMBER: MEncoder's libavformat muxing is presently broken and can 
> generate
> INCORRECT files in the presence of B-frames. Moreover, due to bugs MPlayer
> will play these INCORRECT files as if nothing were wrong!
> *******************************************************************************
> OK, exit.
> Opening video filter: [expand osd=1]
> Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
> Opening video filter: [harddup]
> Opening video filter: [expand w=480 h=320]
> Expand: 480 x 320, -1 ; -1, osd: 0, aspect: 0.000000, round: 1
> Opening video filter: [dsize=480:270]
> Opening video filter: [pp=ci]
> ==========================================================================
> Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
> VDec: vo config request - 720 x 480 (preferred colorspace: Mpeg PES)
> [PP] Using external postprocessing filter, max q = 6.
> Could not find matching colorspace - retrying with -vf scale...
> Opening video filter: [scale]
> The selected video_out device is incompatible with this codec.
> Try appending the scale filter to your filter list,
> e.g. -vf spp,scale instead of -vf spp.
> VDecoder init failed :(
> Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
> Selected video codec: [ffmpeg2] vfm: ffmpeg (FFmpeg MPEG-2)
> ==========================================================================
> VDec: vo config request - 720 x 480 (preferred colorspace: Planar YV12)
> [PP] Using external postprocessing filter, max q = 6.
> VDec: using Planar I420 as output csp (no 1)
> Movie-Aspect is 2.37:1 - prescaling to correct movie aspect.
> x264 [info]: using SAR=32/27
> x264 [info]: using cpu capabilities: MMX2 SSE2 SSE3 Cache64
> [mpeg2video @ 0x86c6590]Warning MVs not available
> [mpeg2video @ 0x86c6590]concealing 1036 DC, 1036 AC, 1036 MV errors
> New_Face failed. Maybe the font path is wrong.n   0mb  A-V:0.000 [0:0]
> Please supply the text font file (~/.mplayer/subfont.ttf).
> subtitle font: load_sub_face failed.
> New_Face failed. Maybe the font path is wrong.
> Please supply the text font file (~/.mplayer/subfont.ttf).
> subtitle font: load_sub_face failed.
> VIDEO CODEC ID: 28f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.007 [0:0]
> AUDIO CODEC ID: 15002, TAG: 0
> Writing header...




More information about the MEncoder-users mailing list