topical media & game development
graphic-processing-learning-21-example-21-5-example-21-5.pde / pde
// Learning Processing
// Daniel Shiffman
// http://www.learningprocessing.com
// Example 21-5: Making a QuickTime movie
// The MovieMaker class is part of Processing's video library.
import processing.video.*;
// Declare MovieMaker object
MovieMaker mm;
void setup() {
size(320, 240);
// Create MovieMaker object with size, filename,
// framerate, compression codec and quality
mm = new MovieMaker(this, width, height, "drawing.mov" , 30, MovieMaker.H263,
MovieMaker.HIGH);
background(255);
}
void draw() {
stroke(0);
strokeWeight(4);
if (mousePressed) {
line(pmouseX, pmouseY, mouseX, mouseY);
}
// A new frame is added to the movie every cycle through draw().
mm.addFrame();
}
void keyPressed() {
// Finish the movie if space bar is pressed!
if (key == ' ' ) {
println( "finishing movie" );
// Do not forget to finish the movie! Otherwise, it will not play properly.
mm.finish();
}
}
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.