Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Video library: why does read() need to be written as a statement in a function?

$
0
0

I've been learning how to use the video library, and I noticed that when you write

     myMovie.read();

by itself and not as a statement in a function (as in the code below), then the playback is jittery. I wondered if someone could explain why that is.

import processing.video.*;
Movie myMovie;

void setup() {
  size(624, 352);
  myMovie = new Movie(this, "1.mp4");
  myMovie.loop();
}

void draw() {
  if (myMovie.available() == true) {
     myMovie.read();
}
  image(myMovie, 0, 0);
}

Viewing all articles
Browse latest Browse all 2896

Trending Articles