Forums > Jitter

Blur edge of movies to black?

March 14, 2008 | 5:43 pm

Hi there,

We’ve all seen it on photos where the outside of the image blurs/fades to black, well I’m now trying to do it to videos. I’m a bit of a beginner still on Jitter so go easy with me if its simple! I’m playing jit.qt.movie in colormode uyvy through a jit.gl.slab and then a jit.gl.videoplane. Preferably I would like to put the fading technique between the slab and the videoplane.

Does anyone have any idea how to do this? I would post my patch, but its far too big.

Cheers for any help,
Ben


March 14, 2008 | 6:54 pm

here is a simple way to this with creating a mask on the alpha channel, the mask creation part comes from one of Andrew Benson’s recipes (#09).
you could also use black and white images as masks or explore jit.epr or jit.bfg for some more dynamic mask generations .
hope it helps :)

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 26 123 207 196617 jit.gl.render oldies @erase_color 0. 0. 0. 1.;
#P newex 26 96 133 196617 t b b erase;
#P newex 26 70 51 196617 qmetro 2;
#P newex 423 340 53 196617 jit.pack;
#P newex 423 302 66 196617 jit.unpack;
#P user jit.pwindow 141 337 82 62 0 0 0 0 1 0;
#P newex 157 229 48 196617 loadbang;
#P newex 142 316 176 196617 jit.matrix 1 char 320 240 @interp 1;
#P newex 143 295 137 196617 jit.matrix mask1 1 char 4 4;
#P newex 143 273 78 196617 jit.fill mask1 0;
#P message 143 253 199 196617 0 0 0 0 0 255 255 0 0 255 255 0 0 0 0 0;
#P newex 352 526 158 196617 jit.window oldies @size 640 480;
#P message 447 250 83 196617 read dishes.mov;
#P newex 423 277 63 196617 jit.qt.movie;
#P newex 423 427 252 196617 jit.gl.videoplane oldies @automatic 0 @blend_enable 1;
#P newex 87 171 40 196617 t b b b;
#P toggle 26 46 15 0;
#P fasten 1 2 3 0 122 210 428 210;
#P fasten 1 1 8 0 107 292 148 292;
#P connect 9 0 11 0;
#P fasten 9 0 13 0 147 335 428 335;
#P connect 13 0 2 0;
#P fasten 1 0 2 0 92 416 428 416;
#P connect 15 0 16 0;
#P fasten 15 2 16 0 153 118 31 118;
#P connect 15 1 1 0;
#P connect 0 0 14 0;
#P connect 14 0 15 0;
#P connect 8 0 9 0;
#P connect 3 0 12 0;
#P connect 12 3 13 3;
#P connect 12 2 13 2;
#P connect 12 1 13 1;
#P connect 7 0 8 0;
#P connect 6 0 7 0;
#P connect 10 0 6 0;
#P connect 4 0 3 0;
#P window clipboard copycount 17;

Quote: benjohnson wrote on Fri, 14 March 2008 18:43
—————————————————-
> Hi there,
>
> We’ve all seen it on photos where the outside of the image blurs/fades to black, well I’m now trying to do it to videos. I’m a bit of a beginner still on Jitter so go easy with me if its simple! I’m playing jit.qt.movie in colormode uyvy through a jit.gl.slab and then a jit.gl.videoplane. Preferably I would like to put the fading technique between the slab and the videoplane.
>
> Does anyone have any idea how to do this? I would post my patch, but its far too big.
>
> Cheers for any help,
> Ben
—————————————————-


March 14, 2008 | 8:24 pm

You also use the tr.vignettes.jxs shader with a slab. There’s an example under "slab-helpers, transition" Vade’s v001 shaders also have a vignette element, in the lomo shader.

dan


March 14, 2008 | 9:41 pm

as Dan mentions the transition shaders , there is tr.edgeblend.jxs that does exactly what you need , i guess

Quote: skyvat wrote on Fri, 14 March 2008 21:24
—————————————————-
> You also use the tr.vignettes.jxs shader with a slab. There’s an example under "slab-helpers, transition" Vade’s v001 shaders also have a vignette element, in the lomo shader.
>
> dan
—————————————————-


March 15, 2008 | 12:47 pm

I tried the ideas of using specific shaders but was having no joy. I loaded up the help file on the ‘tr.edgeblend.jxs’ shader and it was just what I was looking for, but then when I placed it in my patch it wouldn’t work. First I tried changing the shader on the yellow slab, and that didn’t work. So figuring that the shader didn’t like two inputs, I tried adding another slab before the videoplane. Didn’t work either.

I need to be able to crossfade between the two videos still. Does anyone know what I could do to make this work?

Note: this is a very cut down version of my patch but its got the basic parts in that need to be changed.

Thanks for any help
Regards,
Ben

max v2;
#N vpatcher 559 235 1345 819;
#P origin 31 0;
#P toggle 534 246 15 0;
#P window setfont "Sans Serif" 9.;
#P message 534 265 70 196617 fullscreen $1;
#P newex 534 225 58 196617 select 102;
#P newex 534 204 58 196617 key;
#P button 647 234 15 0;
#P number 700 234 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 665 234 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 647 256 88 196617 pak size 640 480;
#P newex 534 292 95 196617 jit.window Window;
#P user jit.fpsgui 2 139 60 196617 0;
#P newex 2 109 102 196617 jit.gl.render Window;
#P toggle 108 31 15 0;
#P newex 108 50 57 196617 qmetro 20;
#P newex 108 72 58 196617 t b b erase;
#P newex 366 289 45 196617 r vid2A;
#P newex 153 289 45 196617 r vid1A;
#P newex 387 167 45 196617 s vid2A;
#P newex 165 167 45 196617 s vid1A;
#P newex 596 428 41 196617 * 0.01;
#P user hslider 596 403 18 128 101 1 0 0;
#P window linecount 2;
#P newex 596 448 72 196617 prepend param amount;
#P window linecount 1;
#P message 347 137 39 196617 time 0;
#P message 317 137 29 196617 stop;
#P message 283 137 33 196617 start;
#P message 387 137 30 196617 read;
#P message 212 137 30 196617 read;
#P window linecount 3;
#P newex 357 334 141 196617 jit.qt.movie @adapt 1 @unique 1 @colormode uyvy @vol 0 @interp 1;
#P newex 136 334 141 196617 jit.qt.movie @adapt 1 @unique 1 @colormode uyvy @vol 0 @interp 1;
#P newex 357 398 141 196617 jit.gl.slab Window @file cc.uyvy2rgba.lite.jxs @automatic 0 @dimscale 2. 1.;
#P newex 136 398 141 196617 jit.gl.slab Window @file cc.uyvy2rgba.lite.jxs @automatic 0 @dimscale 2. 1.;
#P window linecount 1;
#P newex 122 453 245 196617 jit.gl.slab Window @file co.normal.jxs @automatic 0;
#P newex 108 516 183 196617 jit.gl.videoplane Window @automatic 0;
#P newex 108 125 53 196617 t b b b b;
#P fasten 19 0 22 0 113 98 7 98;
#P fasten 19 2 22 0 161 98 7 98;
#P connect 22 0 23 0;
#P connect 21 0 20 0;
#P connect 20 0 19 0;
#P fasten 19 1 0 0 137 109 113 109;
#P connect 0 0 1 0;
#P connect 2 0 1 0;
#P fasten 12 0 2 0 601 482 589 482 589 446 127 446;
#P connect 3 0 2 0;
#P connect 0 1 2 0;
#P fasten 17 0 5 0 158 321 141 321;
#P connect 0 2 5 0;
#P connect 5 0 3 0;
#P fasten 11 0 15 0 352 160 170 160;
#P fasten 9 0 15 0 288 160 170 160;
#P fasten 7 0 15 0 217 160 170 160;
#P fasten 10 0 15 0 322 160 170 160;
#P fasten 18 0 6 0 371 321 362 321;
#P fasten 0 3 6 0 155 189 362 189;
#P connect 6 0 4 0;
#P connect 4 0 2 1;
#P fasten 8 0 16 0 392 160 392 160;
#P fasten 10 0 16 0 322 160 392 160;
#P fasten 11 0 16 0 352 160 392 160;
#P connect 29 0 30 0;
#P connect 30 0 32 0;
#P connect 32 0 31 0;
#P connect 31 0 24 0;
#P fasten 25 0 24 0 652 284 539 284;
#P connect 13 0 14 0;
#P connect 14 0 12 0;
#P connect 28 0 25 0;
#P fasten 26 0 25 1 670 252 691 252;
#P fasten 27 0 25 2 705 252 730 252;
#P pop;


March 15, 2008 | 12:50 pm

Oops, the slab that I was calling the yellow one…. was the one using the co.normal.jxs shader. I think I forgot to change its colour…..!


March 15, 2008 | 2:33 pm


March 15, 2008 | 2:44 pm

I think you need to start a new topic for this, you just replied to mine. You will undoubtedly get a better response if you put it in your own topic.

Regards,
Ben


March 16, 2008 | 2:04 pm

Figured it out, it seemed to just be a matter of adding @blend_enable 1 on the videoplane. Daft the things you miss isn’t it! Cheers for the help guys.

Regards,
Ben


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