// Run this program only in the Java mode inside the IDE, // not on Processing.js (web mode)!! import processing.video.*; Capture cam; void setup() { size(800, 600); // check cameras String[] cameras = Capture.list(); if (cameras.length == 0) { println("There are no cameras available for capture."); exit(); } else { println("Available cameras:"); for (int i = 0; i < cameras.length; i++) { println(i+". "+cameras[i]); } } cam = new Capture(this, cameras[18]); //Another method //cam = new Capture(this, 640, 480, 30); cam.start(); } void draw() { if(cam.available()) { cam.read(); } image(cam, 80, 60); }