Forums > Jitter

movie flicker

February 23, 2006 | 6:33 pm

Hello List,

I am trying to create a patcher where I can mix two effects on one qt
movie. The problem I am having is, when I send two patch cords to the
jit.pwindow, it causes it to flicker, but when I send them separately
everything is allright. So what am I missing here? Any thoughts?

Here is my basic patcher:

#P window setfont "Fixedwidth Serif" 10.;
#P window linecount 1;
#P newex 259 158 184 1441802 jit.matrix bob 4 char 320 240;
#P user jit.pwindow 9 177 82 62 0 1 0 0 1 0;
#P number 383 293 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 292 294 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 384 325 88 1441802 slide_down $1;
#P message 294 325 76 1441802 slide_up $1;
#P newex 205 310 64 1441802 jit.slide;
#P user jit.pwindow 73 322 82 62 0 1 0 0 1 0;
#P number 362 212 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 271 213 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 363 244 88 1441802 slide_down $1;
#P message 273 244 76 1441802 slide_up $1;
#P newex 177 227 64 1441802 jit.slide;
#P user jit.pwindow 19 252 82 62 0 1 0 0 1 0;
#P message 189 94 34 1441802 stop;
#P message 175 76 40 1441802 start;
#P message 161 58 34 1441802 read;
#P newex 57 127 130 1441802 jit.qt.movie 320 240;
#P newex 55 89 58 1441802 metro 30;
#P toggle 60 61 15 0;
#P connect 13 0 12 0;
#P connect 13 0 19 0;
#P connect 7 0 6 0;
#P connect 7 0 19 0;
#P connect 2 0 7 0;
#P connect 2 0 13 0;
#P connect 19 0 18 0;
#P connect 14 0 13 0;
#P connect 15 0 13 0;
#P connect 17 0 15 0;
#P connect 16 0 14 0;
#P connect 10 0 8 0;
#P connect 11 0 9 0;
#P connect 9 0 7 0;
#P connect 8 0 7 0;
#P connect 5 0 2 0;
#P connect 4 0 2 0;
#P connect 3 0 2 0;
#P connect 1 0 2 0;
#P connect 0 0 1 0;
#P window clipboard copycount 20;


February 23, 2006 | 6:41 pm

You can;t send 2 video streams to the same pwindow like that. It’s
simply displaying one stream or the other. Video doesn’t mix the way
MSP audio does by sending multiple patch coords to the same inlet.
You have to explicitly mix them with something like jit.xfade or the
other myriad techniques.

wes


February 23, 2006 | 7:05 pm

That makes totally sense now:/

Thinking I have 5 differents effects to be mixed, can you suggest
which way should I follow in this scenario?
Thank you very much!

best
ilteris.


February 23, 2006 | 7:16 pm

It depends on what you want to accomplish. If you want to mash all 5
together, that’s going to take some doing. If you want to smoothly
mix between the 5, there are any number of ways of doing this. I tend
to use a video buffer connected to an input switch that does fading
between input streams which includes all of the effects as well as a
feedback stream. On the output of the buffer, I usually have some
kind of alphablend.

good luck,
wes


February 23, 2006 | 7:37 pm

If you are merely trying to mix 5 inputs equally, something like this
will work:

#P outlet 30 245 15 0;
#P inlet 398 192 15 0;
#P inlet 306 192 15 0;
#P inlet 214 193 15 0;
#P inlet 122 193 15 0;
#P inlet 30 194 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 30 221 381 196617 jit.expr @expr
"in[0]*0.2+in[1]*0.2+in[2]*0.2+in[3]*0.2+in[4]*0.2" @inputs 5;
#P connect 0 0 6 0;
#P connect 5 0 0 4;
#P connect 4 0 0 3;
#P connect 3 0 0 2;
#P connect 2 0 0 1;
#P connect 1 0 0 0;
#P window clipboard copycount 7;

Cheers,
Andrew B.


February 23, 2006 | 9:11 pm

Thanks guys! Andrew your solution worked like a charm ty. It is slow
though, I think it is a cpu intensive thing that I am trying to
accomplish, it is a weekly project so it is all good! thanks again.

ilteris.


February 23, 2006 | 9:50 pm

hello,
the reason that it is slow is that jit.expr always converts data to
float32 before processing. This is going to create a bottleneck if you
are using 5 char inputs. You could easily break the expression up into
cascaded jit.op objects for better performance with char data:

#P inlet 455 169 15 0;
#P inlet 346 170 15 0;
#P inlet 236 171 15 0;
#P inlet 128 170 15 0;
#P inlet 19 169 15 0;
#P outlet 19 284 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 455 189 108 196617 jit.op @op * @val 0.2;
#P newex 19 263 446 196617 jit.op @op +;
#P newex 19 241 228 196617 jit.op @op +;
#P newex 346 189 108 196617 jit.op @op * @val 0.2;
#P newex 237 218 119 196617 jit.op @op +;
#P newex 237 189 108 196617 jit.op @op * @val 0.2;
#P newex 128 189 108 196617 jit.op @op * @val 0.2;
#P newex 19 218 119 196617 jit.op @op +;
#P newex 19 189 108 196617 jit.op @op * @val 0.2;
#P connect 14 0 8 0;
#P connect 13 0 5 0;
#P connect 12 0 3 0;
#P connect 11 0 2 0;
#P connect 10 0 0 0;
#P connect 7 0 9 0;
#P connect 8 0 7 1;
#P connect 6 0 7 0;
#P connect 4 0 6 1;
#P connect 1 0 6 0;
#P connect 3 0 4 0;
#P connect 5 0 4 1;
#P connect 2 0 1 1;
#P connect 0 0 1 0;
#P window clipboard copycount 15;

Andrew


February 24, 2006 | 1:31 am

yummy! Thank you very much Andrew! I truly appreciate it.

best
ilteris.


Viewing 8 posts - 1 through 8 (of 8 total)