[MPlayer-users] Re: AVI->DVD: Problem understanding expand and scale

Giacomo Comes comes at naic.edu
Mon Oct 10 16:23:00 CEST 2005


On Sun, Oct 09, 2005 at 12:48:49PM +0200, Thomas Heuving wrote:
> Giacomo Comes schrieb am Sat, 8 Oct 2005 14:12:22 -0400:
> >> But it seems to be necessary to do two invokations, as I didn't find
> >>  and nobody mentioned a working example of putting black borders and do
> >>  a scaling in one go.
> >
> > I already told you that that if you do scale-expand you can do it in one pass.
> >
> > For you particular movie
> >
> > -vf scale=684:547,expand=720:576  will add 5% border and
> > -vf scale=648:518,expand=720:576  will add 10% border
> >
> > This numbers assumes that your avi has aspect ratio 1:1 and the mpeg aspect 16/9.
> > If the aspect ratio is different, the numbers have to be modified.
> 
> Can you tell me how you did the math, as I want to do it the next
> time by myself.

a=avi aspect ratio
A=mpeg aspect ratio
W=mpeg width
H=mpeg heigh
o=border (in %)

if a>A
  Eh=(1-o/100)*A*H/a
  Ew=(1-o/100)*W
else 
  Ew=(1-o/100)*W*a/A
  Eh=(1-o/100)*H

-vf scale=Ew:Eh,expand=W:H

Giacomo




More information about the MPlayer-users mailing list