import processing.video.*; MovieMaker mm; void setup() { size(720, 480); // Save uncompressed, at 15 frames per second mm = new MovieMaker(this, width, height, "drawing.mov"); // Or, set specific compression and frame rate options //mm = new MovieMaker(this, width, height, "drawing.mov", 30, // MovieMaker.ANIMATION, MovieMaker.HIGH); background(0, 255, 0); } void draw() { stroke(255, 50, 50); strokeWeight(3); // Draw if mouse is pressed if (mousePressed && pmouseX != 0 && mouseY != 0) { line(pmouseX, pmouseY, mouseX, mouseY); } // Add window's pixels to movie mm.addFrame(); } void keyPressed() { if (key == ' ') { // Finish the movie if space bar is pressed mm.finish(); // Quit running the sketch once the file is written exit(); } }