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.
Page Index Toggle Pages: 1
frame by frame (Read 718 times)
frame by frame
Nov 9th, 2005, 4:52pm
 
Hi,
I'm creating a sketch that initially reads a movie frame by frame and analyses it.

I've just started it, but I can't even get the movie to pause on each frame

It skips frames and crashes after a while.

Also, the sound doesn't pause with the video...

Any ideas??

Cheers
Niall

Code:

import processing.video.*;
Movie myMovie;

int movieFrameRate = 25;
float movieFramesDuration = 1.0/movieFrameRate;
int frameJump = 1;
boolean newFrame = false;

void setup() {
framerate(1);
size(720, 576, OPENGL);
myMovie = new Movie(this, "testmov5.mov");
myMovie.framerate(25);
myMovie.loop();
}

void draw() {
if (newFrame == true) {
myMovie.jump(frameJump*movieFramesDuration);
myMovie.read();
myMovie.pause();
image (myMovie, 0, 0);
frameJump ++;
println("frame: " + frameJump + " seconds: " + (frameJump*movieFramesDuration));
myMovie.play();
}
}

void movieEvent(Movie m) {
newFrame = true;
}


Page Index Toggle Pages: 1