We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Masking video? (Read 816 times)
Masking video?
Aug 23rd, 2009, 12:41am
 
Hi,

Can someone explain to me how to mask() each frame of a video?

I've got it working: but only briefly. The mask flashes on the screen and then vanishes.

My current code looks like:

Quote:
     
import processing.video.*;
Movie myMovie;
PImage b;

void setup() {
 size(360, 240);
 myMovie = new Movie(this, "rain.mov");
 myMovie.speed(0.1);
 myMovie.loop();
 b = loadImage("circle.gif");
}

void draw() {
 myMovie.mask(b);
 image(myMovie, 0, 0);
}

// Called every time a new frame is available to read
void movieEvent(Movie ghost) {
  ghost.read();
}


Cheers,
Will.
Re: Masking video?
Reply #1 - Apr 14th, 2010, 12:02pm
 
I've experienced similar problems. when masking a movie with a still image (in draw), the image will slowly fade out. i can only assume that the alpha is compounding over time.
the only thing that has worked for me so far is to make the movie with an alphs (rgb + a) and use the movie as the mask for itself.
it would be great to use a still image, since the rgba movie is much larger.
Page Index Toggle Pages: 1