FrameRate drop when I play movie

ArrayList<Integer> x = new ArrayList<Integer>(), y = new ArrayList<Integer>();
import processing.sound.*;
SoundFile file;
import processing.video.*;
Movie movie;

void setup()
{
  size(400, 450);
  background(0);
  x.add(10);
  y.add(10);
  gate = wR/ts;
  speed = new PVector(0, 0);
  frameRate(60);
  pomme = loadImage("pomme.png");
  file = new SoundFile(this, "luz-de-luna.wav");
  file.amp(0.25);
  file.loop();
  movie = new Movie(this, "gameplay.mov");
  movie.loop();
}

void draw()
{
  image(movie, 0, 0);
  filter(BLUR, 4);
  fill(0);
  textAlign(CENTER);
  textSize(50);
  text(frameRate, 300, 300);
  //menu();
}

The frameRate drop when I play a Movie, can u explain me why pls ?

Hi, I didn’t post all of my code because it’s not necessary, the problem is the same. I did a snake game and i wanted to put a recorded video as a background of the game menu, but with the movie, the framerate drop to 15 and without the movie I have 60fps. Can u help me pls ? I don’t understand why the framerate drop like that ?

1 Like

Hello,

Please format your code:
https://discourse.processing.org/faq#format-your-code
:)

Hi!

Try commenting out filter(blur). The filter() function in Processing takes a lot of CPU.

1 Like

Yeah, it’s good right now, thanks :slight_smile:

1 Like

Yeah sorry, i didn’t understand how it worked, thanks for the link