// download the MovieMaker library by Daniel Shiffman: // http://www.shiffman.net/2006/05/18/moviemaker/ import moviemaker.*; import quicktime.std.StdQTConstants; import quicktime.std.StdQTConstants4; MovieMaker movie; // constants for ANIMATION and PNG codecs, // which are better for making uncompressed movies public static final int ANIMATION = StdQTConstants.kAnimationCodecType; public static final int PNG = StdQTConstants4.kPNGCodecType; void setup() { size(400,400); size(400,400); smooth(); // initialize MovieMaker movie=new MovieMaker(this, width,height, "test.mov",PNG,MovieMaker.HIGH, // name, codec and quality 25); // framerate background(255); } void draw() { ellipse(random(width),random(height), 30,30); // load pixels so we can save the frame loadPixels(); // add current frame to movie if(movie!=null) movie.addFrame(pixels,width,height); } public void mousePressed() { // if "movie" is not null, end the movie if(movie!=null) movie.finishMovie(); }