[MPlayer-users] ANNOUNCE: video filters

Arpi arpi at thot.banki.hu
Mon Apr 8 02:48:01 CEST 2002


Hi,

We've finished the video filter layer, at least the basics of it.
For now, there are just a few filters, but they are usefull:

crop=w:h:x:y    cropping w*h area from x;y
expand=w:h:x:y  expand image to w*h, and place original to x;y
pp=flags        postprocessing (same as -pp flags was)
scale=w:h       software scaling and/or colorspace conversion

the filters try to do direct rendering between eachother to improve speed
(and decrease number of allocated memory buffers and copy between them)

to set up the filter pipeline, use -vop filter1,filter2,... option.
filter parameters are optional, you can leave them or few of the parameters.
they all have defaults, x;y mostly to 0;0 or center, w*h to original size.

filters are queued starting from libvo, so filter1 will be the last in the
pipeline, just before the libvo. the lats filter in -vop list will interface
with the codec.

few words about pp:
in old mplayer versions, native codecs used Michael's external
postprocessing code automatically. binary codecs (dshow and divx4) usually
had the postprocessing code built-in.
now, codecs without builtin pp (ffmpeg codecs, libmpeg12) requires the pp
filter to be enabled (-vop pp) to work with -pp/-npp/-autoq options. 
for example:
  mplayer divxmovie.avi -vc ffdivx -vop pp -autoq 100

it _may_ will change in the near _future_, so when no -vop option used, it
will try to find out what filters to enable...

if you use more than 1 filters, put pp to the end (unless you need
colorspace conversion to yv12, then -vop ...,pp,scale)

you can apply filters more than once, including pp. but it has no much sense :)

the software scaler can be used with all -vo drivers, even with ones with
hardware scaling, so you can for exampel downscale with your upscale-only
vga card while still using hardware yuv->rgb.
the scaler filter also usable to do colorspace conversion between major
formats (bgr 15/16/24/32,yv12) so you can play using rgb-only codecs with
yuv-only vo:
   mplayer vivo2sample.viv -vop scale -vo xv

these filters work with mplayer and mencoder.
it means, you can use crop with mplayer, reducing video bandwith usage by
cutting down black bands from the image - or you can expand it ti get black
borders for the subtitles!
mencoder doesn't support resizing operations yet (it will resize the image
but will encode at the original resolution) - it will be fixed soon.

i'm planning to change mencoder codecs to vf filters, and also change mpeg1
rt encoders (dxr3/dvb) to vf filters (as yv12->mpegpes converter).
it will simplify code and generalize stuff.

these filters work together with direct rendering, even better than without
filters. so, yo can try to use option -dr to get better performance!
note, that osd/sub doesn't like DR with most vo drivers - i can do nothing
with it. partial updates are both the advantage (better speed) and the
disadvantage (not well working sub/osd or resizing) of DR.

ok, now the bad side: there are bugs. i don't know where, but there must be
some. report them, but don't forget to read docs/bugreports, _and_ include
the _whole_ mplayer -v [options] log!!! it will be long, but each line has
it's quantity of information and may be important to track down the bug.


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu




More information about the MPlayer-users mailing list