Log in

View Full Version : modify variables


Ignus2
2nd December 2006, 16:26
I read somewhere, that filters never modify variables, and always return a clip.

I want some of my plugins to "communicate" with each other, I mean: one of them does some processing, generates some parameters, and another filter generates a clip based on the parameters. BUT i also want the first filter to optionally produce a clip if desired (for visual debugging).

So to put it short: how can one filter pass parameters to another (without using the clip return value)?
I want something like pass-by-reference, as in C++.
How can I achieve this?

Thanks in advance.
--
Greets,
I.

foxyshadis
2nd December 2006, 17:43
There's a few things you can do, the classic way is to simply use global variables, but besides being ugly it's impossible to multithread easily. You can dump your values into a clip - Clouded and Manao did some pretty neat stuff that way. If you need debugging output, you can generate a clip of size (width)x(height+2) with the top two lines, or as many as you need, being your data structures, and the rest being the raw video.

Ignus2
2nd December 2006, 18:24
If you need debugging output, you can generate a clip of size (width)x(height+2) with the top two lines, or as many as you need, being your data structures, and the rest being the raw video.

EXACTLY what I had in mind. I just thought, that there is some other, more "elegant" way to do it :)

I`ll go this way then.

Thanks!

jmac698
2nd December 2006, 18:30
I really see a need to pass metadata around in video processing, for example the color matrix is hidden in the actual video as "hints" with mpeg2source plugin. We need a real backchannel.

Fizick
2nd December 2006, 20:23
I am waiting metadata a long time...
many discussion were about it, (padding. etc)
will wait 2.6-2.7