# FrameRate drop when I play movie

**URL:** <https://discourse.processing.org/t/framerate-drop-when-i-play-movie/21480>\
**Category:** Libraries\
**Tags:** homework\
**Created:** [June 1, 2020, 3:16pm UTC](https://discourse.processing.org/t/framerate-drop-when-i-play-movie/21480 "2020-06-01T15:16:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![OohYuma](https://avatars.discourse-cdn.com/v4/letter/o/96bed5/32.png) [@OohYuma](https://discourse.processing.org/u/OohYuma)\
**Post date:** [June 1, 2020, 3:16pm UTC](https://discourse.processing.org/t/framerate-drop-when-i-play-movie/21480/1 "2020-06-01T15:16:05Z")

</div>

```auto
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 ?

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [June 2, 2020, 1:37am UTC](https://discourse.processing.org/t/framerate-drop-when-i-play-movie/21480/2 "2020-06-02T01:37:57Z")

</div>

Hello,

Please format your code:  
[https://discourse.processing.org/faq#format-your-code](https://discourse.processing.org/faq#format-your-code)  
`:)`

---

<div class="post-metadata">

**Author:** ![musiciantriescoding](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/musiciantriescoding/32/7662_2.png) [@musiciantriescoding](https://discourse.processing.org/u/musiciantriescoding)\
**Post date:** [June 2, 2020, 7:18am UTC](https://discourse.processing.org/t/framerate-drop-when-i-play-movie/21480/3 "2020-06-02T07:18:50Z")

</div>

Hi!

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

---

<div class="post-metadata">

**Author:** ![OohYuma](https://avatars.discourse-cdn.com/v4/letter/o/96bed5/32.png) [@OohYuma](https://discourse.processing.org/u/OohYuma)\
**Post date:** [June 2, 2020, 7:43am UTC](https://discourse.processing.org/t/framerate-drop-when-i-play-movie/21480/4 "2020-06-02T07:43:00Z")

</div>

Yeah, it’s good right now, thanks 🙂

---

<div class="post-metadata">

**Author:** ![OohYuma](https://avatars.discourse-cdn.com/v4/letter/o/96bed5/32.png) [@OohYuma](https://discourse.processing.org/u/OohYuma)\
**Post date:** [June 2, 2020, 7:43am UTC](https://discourse.processing.org/t/framerate-drop-when-i-play-movie/21480/5 "2020-06-02T07:43:40Z")

</div>

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