processing.video
Class MovieMaker

java.lang.Object
  extended by processing.video.MovieMaker

public class MovieMaker
extends java.lang.Object

Library to create a QuickTime movie from a Processing pixel array. Written by Daniel Shiffman. Thanks to Dan O'Sullivan and Shawn Van Every.

Please note that some constructors and variable names were altered slightly when the library was added to the Processing distribution.

 // Declare MovieMaker object
 MovieMaker mm;

 void setup() {
   size(320, 240);

   // Create MovieMaker object with size, filename,
   // compression codec and quality, framerate
   mm = new MovieMaker(this, width, height, "drawing.mov", 30,
                       MovieMaker.H263, MovieMaker.HIGH);
   background(160, 32, 32);
 }

 void draw() {
   stroke(7, 146, 168);
   strokeWeight(4);

   // Draw if mouse is pressed
   if (mousePressed) {
     line(pmouseX, pmouseY, mouseX, mouseY);
   }

   // Add window's pixels to movie
   mm.addFrame();
 }

 void keyPressed() {
   // Finish the movie if space bar is pressed!
   if (key == ' ') {
     mm.finish();
   }
 }
 


Field Summary
static int ANIMATION
           
static int BASE
           
static int BEST
           
static int BMP
           
static int CINEPAK
           
static int CMYK
           
static int COMPONENT
           
static int GIF
           
static int GRAPHICS
           
static int H261
           
static int H263
           
static int H264
           
static int HIGH
           
static int JPEG
           
static int LOSSLESS
           
static int LOW
           
static int MEDIUM
           
static int MOTION_JPEG_A
           
static int MOTION_JPEG_B
           
static int MS_VIDEO
           
static int RAW
           
static int SORENSON
           
static int VIDEO
           
static int WORST
           
 
Constructor Summary
MovieMaker(PApplet p, int _w, int _h, java.lang.String _filename)
          Create a movie with the specified width, height, and filename.
MovieMaker(PApplet p, int _w, int _h, java.lang.String _filename, int _rate)
          Create a movie with the specified width, height, filename, and frame rate.
MovieMaker(PApplet p, int _w, int _h, java.lang.String _filename, int _rate, int _codecType, int _codecQuality)
          Create a movie with the specified width, height, filename, frame rate, and codec type and quality.
MovieMaker(PApplet p, int _w, int _h, java.lang.String _filename, int _rate, int _codecType, int _codecQuality, int _keyFrameRate)
          Create a movie with the specified width, height, filename, frame rate, codec type and quality, and key frame rate.
 
Method Summary
 void addFrame()
           
 void addFrame(int[] _pixels, int w, int h)
           
 void dispose()
           
 void finish()
          Close out and finish the movie file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RAW

public static final int RAW
See Also:
Constant Field Values

ANIMATION

public static final int ANIMATION
See Also:
Constant Field Values

BASE

public static final int BASE
See Also:
Constant Field Values

BMP

public static final int BMP
See Also:
Constant Field Values

CINEPAK

public static final int CINEPAK
See Also:
Constant Field Values

COMPONENT

public static final int COMPONENT
See Also:
Constant Field Values

CMYK

public static final int CMYK
See Also:
Constant Field Values

GIF

public static final int GIF
See Also:
Constant Field Values

GRAPHICS

public static final int GRAPHICS
See Also:
Constant Field Values

H261

public static final int H261
See Also:
Constant Field Values

H263

public static final int H263
See Also:
Constant Field Values

H264

public static final int H264

JPEG

public static final int JPEG
See Also:
Constant Field Values

MS_VIDEO

public static final int MS_VIDEO
See Also:
Constant Field Values

MOTION_JPEG_A

public static final int MOTION_JPEG_A
See Also:
Constant Field Values

MOTION_JPEG_B

public static final int MOTION_JPEG_B
See Also:
Constant Field Values

SORENSON

public static final int SORENSON
See Also:
Constant Field Values

VIDEO

public static final int VIDEO
See Also:
Constant Field Values

WORST

public static final int WORST
See Also:
Constant Field Values

LOW

public static final int LOW
See Also:
Constant Field Values

MEDIUM

public static final int MEDIUM
See Also:
Constant Field Values

HIGH

public static final int HIGH
See Also:
Constant Field Values

BEST

public static final int BEST
See Also:
Constant Field Values

LOSSLESS

public static final int LOSSLESS
See Also:
Constant Field Values
Constructor Detail

MovieMaker

public MovieMaker(PApplet p,
                  int _w,
                  int _h,
                  java.lang.String _filename)
Create a movie with the specified width, height, and filename. The movie will be created at 15 frames per second. The codec will be set to RAW and quality set to HIGH.


MovieMaker

public MovieMaker(PApplet p,
                  int _w,
                  int _h,
                  java.lang.String _filename,
                  int _rate)
Create a movie with the specified width, height, filename, and frame rate. The codec will be set to RAW and quality set to HIGH.


MovieMaker

public MovieMaker(PApplet p,
                  int _w,
                  int _h,
                  java.lang.String _filename,
                  int _rate,
                  int _codecType,
                  int _codecQuality)
Create a movie with the specified width, height, filename, frame rate, and codec type and quality. Key frames will be set at 15 frames.


MovieMaker

public MovieMaker(PApplet p,
                  int _w,
                  int _h,
                  java.lang.String _filename,
                  int _rate,
                  int _codecType,
                  int _codecQuality,
                  int _keyFrameRate)
Create a movie with the specified width, height, filename, frame rate, codec type and quality, and key frame rate.

Method Detail

addFrame

public void addFrame()

addFrame

public void addFrame(int[] _pixels,
                     int w,
                     int h)

finish

public void finish()
Close out and finish the movie file.


dispose

public void dispose()