/** Show video using requested capture parameters * @author Mithat Konar */ import processing.video.*; Capture cam; final int CAM_WIDTH = 320; final int CAM_HEIGHT = 240; final int FPS = 15; void setup() { size(CAM_WIDTH, CAM_HEIGHT); if (Capture.list().length == 0) { println("There are no cameras available for capture."); exit(); } // Instantiate a new Capture object, requesting the specs: cam = new Capture(this, CAM_WIDTH, CAM_HEIGHT, FPS); cam.start(); // In Processing 2.0, you need to start the capture device } void draw() { if (cam.available() == true) { cam.read(); } image(cam, 0, 0); }