Update: MovieMaker is now part of Processing’s core video library so this post is now irrelevant!
Based on some code from Shawn Van Every and Dan O’Sullivan, I’ve created a Processing library that allows you to take any pixel array (from the window or from a PImage) and create a quicktime movie.
E-mail me bug reports, questions, comments, etc.!
Example code:
import moviemaker.*; MovieMaker mm; float theta = 0; void setup() { size(200,200); mm = new MovieMaker(this,width,height,"p5test.mov", MovieMaker.JPEG, MovieMaker.HIGH,30); } void draw() { background(sin(theta)*127+127,255,cos(theta)*127+127); theta += 0.05; loadPixels(); mm.addFrame(pixels,width,height); } public void mousePressed() { mm.finishMovie(); } |
Available constants:
code: RAW, JPEG, CINEPAK, SORENSON, VIDEO
quality: LOW, MEDIUM, HIGH, BEST