[MPlayer-users] DivX -> VCD + maintaining aspect ratio = impossible OR Howto ADD black borders

Andreu Escudero lemon at canuda.net
Tue Oct 14 21:16:50 CEST 2003


On dt, 2003-10-14 at 20:35, Marc wrote:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> Extracted from the man page:
> 
> >
> >     expand[=w:h:x:y:o]
> >        Expands (not scales) movie resolution to  the  given value  and
> >        places  the  unscaled original at coordinates x, y.  Can be used
> >        for placing subtitles/OSD in the resulting black bands.
> >
> >        w,h  expanded width,height (default: original  width,height).
> >        Negative  values  for  w and h are treated as offsets to
> >        the original size.
> >
> >        EXAMPLE
> >        expand=0:-50:0:0
> >        adds a 50 pixel border to the bottom of the picture
> >        x,y  position  of  original  image on the expanded image
> >(default: center)
> >
> >        o    OSD/subtitle rendering
> >             0: disable (default)
> >             1: enable
> >
> >  
> >
> >  
> >
> h3h3... I searched for "borders" (should have looked for "border")
> 
> encoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -nosound -vf 
> expand=592:480,scale=352:288 '/windows/E/Incoming/AW.avi' -o 
> '/windows/E/AW.mpg'
> -> only green video ... totally wrecked (BUT 352:288)
> 
> encoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -nosound -vf 
> expand=592:480 -vop scale=352:288 '/windows/E/Incoming/AW.avi' -o 
> '/windows/E/AW.mpg'
> -> good video but 592x480 (=he added the borders but didn't resize 
> afterwards)
> 
> mencoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -nosound -vf 
> expand=20:20:0:0 -vop scale=352:288 '/windows/E/Incoming/AW.avi' -o 
> '/windows/E/AW.mpg'
> -> good video... but no resize and no borders
> 
> mencoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -nosound -vop 
> scale=352:208 -vf expand=352:288 '/windows/E/Incoming/AW.avi' -o 
> '/windows/E/AW.mpg'
> -> good video... but no resize and no borders
> 
> mencoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -nosound -vf 
> expand=20:20:0:0 -vf scale=352:288 '/windows/E/Incoming/AW.avi' -o 
> '/windows/E/AW.mpg'
> -> good video... resized to 352x288 but no borders (-> streteched)
> 
> mencoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -nosound -vf 
> expand=20:20:0:0,scale=352:288 '/windows/E/Incoming/AW.avi' -o 
> '/windows/E/AW.mpg'
> -> good video... resized to 352x288 but no borders (-> streteched)
> 
> mencoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -nosound -vop 
> expand=20:20:0:0,scale=352:288 '/windows/E/Incoming/AW.avi' -o 
> '/windows/E/AW.mpg'
> -> good video... resized to 352x288 but no borders (-> streteched
> 
> I am very new to mplayer... could someone please post me a correct 
> commandline???
> I want an 592x256 avi file down to 352x288 (so resized + borders added)
> 
> thx in advance :-D

-vop is the OLD option to apply filters, they are applied in reverse
order.
-vf is the NEW option to apply filters, they are applied in the given
order.
You should use one or the other, but not both!
Different filters are sepparated by commas.

So, to resize a 592x256 to obtain a 352x288 with black borders, then you
shoud resize to 352x166 (I assume the source avi has square pixels,
where the MPEG pixels 352x288 are not square, when using square pixels
it would be 384x288, so 384x166 with square pixels = 352x166 with MPEG
pixels (CCIR or something like this)). and after that expand to 352x288
There are two ways:

mencoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -nosound -vf
scale=352:166,expand=352:288 '/windows/E/Incoming/AW.avi' -o
'/windows/E/AW.mpg'

or

mencoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -nosound -vop
expand=352:288,scale=352:166 '/windows/E/Incoming/AW.avi' -o
'/windows/E/AW.mpg'


> 
> _______________________________________________
> RTFM!!!  http://www.MPlayerHQ.hu/DOCS
> Search:  http://www.MPlayerHQ.hu/cgi-bin/htsearch
> http://mplayerhq.hu/mailman/listinfo/mplayer-users



More information about the MPlayer-users mailing list