Created
December 3, 2010 00:59
-
-
Save rafapolo/726404 to your computer and use it in GitHub Desktop.
salva cada frame de um movie como uma imagem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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