Processing_+Video+Capture

code //imports the video library import processing.video.*; //variable for webcam Capture cam;

void setup { size(640, 480, P3D); //set the dimensions of the output video (currently set to the size of the screen) cam = new Capture(this, width, height); }

void draw { //if a webcam is available, output the video if (cam.available == true) { cam.read;

//used to flip video so the output video mirrors what the camera sees pushMatrix; scale(-1.0, 1.0); //output the flipped video at this location (currently set to 20px from the right and 20px down) image(cam,-cam.width+20,20); popMatrix;

} } code Note: Video capture does not work online. To work around this upload a screenshot of the sketch working and provide a download link to your applet folder.