[MPlayer-users] Mencoder: Changing frame rate (RealMedia to vcd)

Giacomo Comes comes at naic.edu
Sat Jan 1 20:35:09 CET 2005


On Sat, Jan 01, 2005 at 10:49:05AM -0800, Bill Moseley wrote:
> On Sat, Jan 01, 2005 at 11:17:42AM -0400, Giacomo Comes wrote:
> > I disagree with the whole story of expand or crop.
> > Just -vf scale=352:240 is enough.
> > The Realmedia video is 320x240 (aspect 4/3), you scale to 352x240 and that's it.
> > mencoder will add 4/3 aspect ratio to the mpeg stream and the player will
> > take the 352x240 video and scale it.
> 
> That makes sense.  The player scales it back from 352x240 => 352x264.
> 
> 
> > The crop/expand stuff would be required if you set 1:1 aspect ratio,
> > (-lavcopts aspect=1), but that's unnecessary because VCD usually have 4/3 aspect ratio.
> > Belive me, I have been working A LOT on scaling and aspect ratio with both
> > mencoder and yuvscaler in encode2mpeg
> 
> What about other another aspect ratio?:
> 
> $ tcprobe -i test.avi
> [tcprobe] MPEG program stream (PS)
> [tcprobe] summary for test.avi, (*) = not default, 0 = not detected
> import frame size: -g 640x368 [720x576] (*)
>      aspect ratio: 1:1 
>        frame rate: -f 30.000 [25.000] frc=5 (*)
>                    PTS=161.2929, frame_time=33 ms, bitrate=104857 kbps
>       audio track: -a 0 [0] -e 44100,16,2 [48000,16,2] -n 0x50 [0x2000] (*)
>                    PTS=47721.8576, bitrate=224 kbps
>                    -D -1426816 --av_fine_ms -31 (frames & ms) [0] [0]
> 
> I assume that I can use aspect=16/9 in that case since it's basically
> in 16:9 format.

That's correct.

> 
> But what if the image size is something else that doesn't fit nicely
> into 4:3 or 16:9.  Then I'd need to "expand" to make it fit (assuming
> I want to preserver the full frame size and original aspect ratio)
> which adds black bars.


> Oh Geeze.  I don't really get it yet, though.  Once it is expanded it
> needs to be resized to fit the stored frame size.  Do I have this
> right?  For DVD the stored image size is 720x480.  If it's flagged
> NTSC 16:8 then it is resized to 853x480, and if it's flagged 4:3 it's
> resized to 720x540.  I'm still trying to understand what happens with
> 480x480 svcd.

In general going from resolution A aspect B to resolution C aspect D
requires expand and scale or scale and expand.
(the numbers depend of the initial resolution/aspect and final resolution/aspect
and they are different if you first scale and then expand or viceversa)
I suggest first scale and then expand. The other way doesn't work all the time.
(MPlayer bug)
To make things more confusing :-), a similar result can be obtained with crop
instead of expand. 

By the way encode2mpeg deals with all these situations. The option
-mpegfixaspect is your friend.

> In case you cannot tell, I'm struggling to learn about this stuff.
> It's easy to spend hours and hours reading and just getting more
> confused.  Or at least realize how little I know so far... ;)
> 
> I'll try out encode2mpeg -- my goal is to learn more, not just create
> the media.  I suspect looking over that script will be instructive.

Go ahead. I hope you will find your answers.

> 
> My simple understanding is that the video is either marked 4:3 or
> 16:9 and that tells the player to either resize the hight or width of
> the frame.

Right. Just to be more precise, MPlayer sometimes resize the hight and sometimes
the width because it always expand the video. If you exapand or shrink then
you can do it always only to the hight or only to the width.
Of course, expanding is better because you don't loose information.

Giacomo




More information about the MPlayer-users mailing list