Slow performance of OpenGL with GSVideo
in
Contributed Library Questions
•
2 years ago
I've got a .mov I wish to play with GSVideo rendered in OpenGL, however I get very slow performance. I've seen this thread:
http://forum.processing.org/topic/gsvideo-poor-performance-with-opengl which helped a bit, but there aren't many details to go on.
ANyone know how I can speed up the playing of a movie?
This example code is very slow for example (OSX Leopard, Processing v1.2.1, GLGraphics 0.9.4, GSVideo 0.7):
import processing.opengl.*;
import codeanticode.glgraphics.*;
import codeanticode.gsvideo.*;
GSMovie myMovie;
GLTexture tex;
void setup() {
size(640, 480, GLConstants.GLGRAPHICS);
background(0);
// Load and play the video in a loop
myMovie = new GSMovie(this, "mymovie.mov");
myMovie.loop();
tex = new GLTexture(this);
}
void movieEvent(GSMovie myMovie) {
myMovie.read();
}
void draw() {
//tint(255, 20);
tex.putPixelsIntoTexture(myMovie);
image(tex, mouseX-myMovie.width/2, mouseY-myMovie.height/2,50,50);
}
Edit:
I should say that the movie is big at 1920x1080. The same code with station.mov works ok.
http://forum.processing.org/topic/gsvideo-poor-performance-with-opengl which helped a bit, but there aren't many details to go on.
ANyone know how I can speed up the playing of a movie?
This example code is very slow for example (OSX Leopard, Processing v1.2.1, GLGraphics 0.9.4, GSVideo 0.7):
import processing.opengl.*;
import codeanticode.glgraphics.*;
import codeanticode.gsvideo.*;
GSMovie myMovie;
GLTexture tex;
void setup() {
size(640, 480, GLConstants.GLGRAPHICS);
background(0);
// Load and play the video in a loop
myMovie = new GSMovie(this, "mymovie.mov");
myMovie.loop();
tex = new GLTexture(this);
}
void movieEvent(GSMovie myMovie) {
myMovie.read();
}
void draw() {
//tint(255, 20);
tex.putPixelsIntoTexture(myMovie);
image(tex, mouseX-myMovie.width/2, mouseY-myMovie.height/2,50,50);
}
Edit:
I should say that the movie is big at 1920x1080. The same code with station.mov works ok.
1