Skip to content

Instantly share code, notes, and snippets.

@rafapolo
Created December 3, 2010 00:59
Show Gist options
  • Save rafapolo/726404 to your computer and use it in GitHub Desktop.
Save rafapolo/726404 to your computer and use it in GitHub Desktop.
salva cada frame de um movie como uma imagem
import processing.video.*;
Movie myMovie;
float framesPerSecond = .1;
float currentSecond = 0;
int frame = 0;
void setup() {
size(640, 480, P3D);
background(0);
myMovie = new Movie(this, "/Users/rafaelpolo/Movies/P1020326.mov");
myMovie.speed(1);
myMovie.play();
}
void movieEvent(Movie myMovie) {
myMovie.read();
}
void draw() {
myMovie.jump(currentSecond);
image(myMovie,0,0);
currentSecond += framesPerSecond;
frame++;
saveFrame("/Users/rafaelpolo/Desktop/output_"+frame+".png");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment