Reference for Processing version 1.1+. If you have a previous version, use the reference included with your software. If you see any errors or have suggestions, »please let us know. If you prefer a more technical reference, visit the »Processing Javadoc.

Name

### Capture

Examples

    import processing.video.*;
    Capture myCapture;

    void setup()
    {
      size(200, 200);

      // The name of the capture device is dependent those
      // plugged into the computer. To get a list of the
      // choices, uncomment the following line
      // println(Capture.list());
      // And to specify the camera, replace "Camera Name"
      // in the next line with one from Capture.list()
      // myCapture = new Capture(this, width, height, "Camera Name", 30);

      // This code will try to use the last device used
      // by a QuickTime program
      myCapture = new Capture(this, width, height, 30);
    }

    void captureEvent(Capture myCapture) {
      myCapture.read();
    }

    void draw() {
      image(myCapture, 0, 0);
    }

Description | Datatype for storing and manipulating video frames from an attached capture device such as a camera. Use Capture.list() to show the names of any attached devices. Using the version of the constructor without name will attempt to use the last device used by a QuickTime program.

Methods

read() | Reads the current image
available() | Returns true when a new image is available
list() | Lists the devices current attached and on
frameRate() | Sets how often new frames are read
stop() | Stops capturing frames

Constructor

    Capture(parent, width, height)
    Capture(parent, width, height, fps)
    Capture(parent, width, height, name, )
    Capture(parent, width, height, name, fps)

Parameters

parent | PApplet: typically use "this"
width | int: width of the frame
height | int: height of the frame
fps | int: number of frames to read per second
name | String: name of the camera

Usage | Application
Related | captureEvent()

Updated on June 14, 2010 12:05:23pm EDT