We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpVideo Capture,  Movie Playback,  Vision Libraries › Slow playback speed with random access to frames
Page Index Toggle Pages: 1
Slow playback speed with random access to frames (Read 500 times)
Slow playback speed with random access to frames
Jun 1st, 2008, 2:29am
 
Hi,

I'm trying to create a video player which instead of playing a video linearly, the cursor jumps to random frames.

But I get a very very low framerate :(

The video is a DV clip converted to quicktime. I've tried different quicktime codecs: H.264, M-JPEG, etc and the result is always the same: slow.

I've tried doing the same in vvvv.org and everything runs fast and smooth (using AVI files) so I wonder what I'm doing wrong.

Any ideas why I'm getting such a slow output?

Code:

import processing.opengl.*;
import processing.video.*;

Movie myMovie;
float t0;
float t;

void setup() {
size(720, 576, OPENGL);
frameRate(30);
// Load and play the video in a loop
myMovie = new Movie(this, "R:/movie.mov");
myMovie.loop();
myMovie.speed(0);
t0 = millis();

}


void movieEvent(Movie myMovie) {
t = getMoviePosition();
println(t + " " + myMovie.duration());
myMovie.jump(getMoviePosition() + random(10) - 5);
}


void draw() {
myMovie.read();
image(myMovie, 0,0);

if (t > myMovie.duration()) {
println("finished!");
exit();
}

}

float getMoviePosition() {
float t = ( millis() - t0) / 1000;
return t;
}
Page Index Toggle Pages: 1