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

Help figuring out error when using Video library

$
0
0

This is my code that is currently used to cycle through 3 different videos by pressing Q:

import processing.video.*;
static final int movieCount = 3;
final Movie[] myMovie = new Movie[movieCount];
int index;
int maxMovieIndex = movieCount-1;

void setup() {
  size(1920, 1080);
  myMovie[0] = new Movie(this, "scene_0.mp4");
  myMovie[1] = new Movie(this, "scene_1.mp4");
  myMovie[2] = new Movie(this, "scene_2.mp4");
  myMovie[0].loop();
}

void draw() {
  set(0, 0, myMovie[index]);
  image(myMovie[index], 0, 0);

  println("index: " + index);
}

void keyPressed()
{
 if (key == 'q')
 {
   myMovie[index].pause();
   if (index != maxMovieIndex)
   {
    index++;
   }
   else
   {
    index = 0;
   }
   myMovie[index].loop();
 }
}

void movieEvent(Movie m) {
  m.read();
}

It runs, but if I exit after doing a switch, I get an error in the console upon exit:

(java.exe:6620): GStreamer-CRITICAL **: Trying to dispose element Movie Player, but it is in PAUSED instead of the NULL state. You need to explicitly set elements to the NULL state before dropping the final reference, to allow them to clean up. This problem may also be caused by a refcounting bug in the application or some element.

(java.exe:6620): GStreamer-CRITICAL **: Trying to dispose element inputselector0, but it is in PAUSED instead of the NULL state. You need to explicitly set elements to the NULL state before dropping the final reference, to allow them to clean up. This problem may also be caused by a refcounting bug in the application or some element.

What does this mean, and how do I fix it? I guess it has to do with how the Movie object is used, but I haven't seen examples in the documentation on why/how to safely exit.


Viewing all articles
Browse latest Browse all 2896

Trending Articles