[MPlayer-dev-eng] [PATCH] Video mixer with mencoder Part 5/3

Ötvös Attila oattila at chello.hu
Wed Jan 2 20:40:37 CET 2008


Hi All!

This patch is big because you download from,please:

http://onebithq.com/root/mplayer/videomixer/download/20080102

Patch file: df.patch
Depend: filter.pacth, stream.patch

I create dynamic filter handler in dynamicfilter.c
vf_export.c and vf_import.c

The dynamic commands can modify filter parameters with pts position 
of 'master' stream.

Example "fade in":
pts: 10.00, alpha: 0 (transparent)
pts: 15.00, alpha: 127 (half opacity)
pts: 20.00, alpha: 255 (full opacity)

mencoder -dfcmd 1:0:static:import:10.0::0,1:0:dynamic:import:20.0::255

1 - stream id
0 - video filter (1 - audio)
static - set to
import - filter name
10.0 - pts position
:0 - alpha parameters of filter

1 - stream id
0 - video filter
dynamic - calculate parameters value from prev command
import - filtername
20.0 - pts position
:255 - alpha

Calculate code:
spts = 10.0 from dfcmd1 (pts)
epts = 20.0 from dfcmd2 (pts)
sx = 0 from dfcmd1 (alpha)
ex = 255 from dfcmd2 (alpha)
pts = current master pts
x = alpha value to master pts

rate=(pts-spts)/(epts-spts);
x=(ex-sx)*rate+sx;

Best regards!
Attila



More information about the MPlayer-dev-eng mailing list