problem with a dynamic mask over a video

edited May 2014 in Questions about Code

I use this code wich is actually working exept that at random time i see a flash of the full-frame of my video (non masked) someone can explain me why?

Movie myMovie;

PGraphics gBuffer;
void setup() {
  size(1280, 720);
  myMovie = new Movie(this, "");
  gBuffer = createGraphics( width, height);

void draw() {
  gBuffer.background(0);//clear the mask
  gBuffer.ellipse(mouseX,mouseY,250,250);//draw a new circle
  myMovie.mask(gBuffer);//apply the mask to the image
  image(myMovie, 0, 0);

void movieEvent(Movie m) {;  


  • Please format your code by highlighting it and pressing Ctrl+K

  • This is because the movieEvent function is firing at a different rate than the draw loop. It causes a bit of skipping, but if you delete the movieEvent function and do in the draw loop this problem is resolved.

Sign In or Register to comment.