Page 1 of 1

Processing Video Input Example

PostPosted: Tue Nov 25, 2014 5:31 pm
by BenChang
A simple program to get started with video input. More complete examples are in the Examples folder in Processing (File->Examples->Libraries->Video->Capture)

Code: Select all
import processing.video.*;

Capture cam;

void setup()
{
   size(640,480);
   cam = new Capture(this,640,480);
   cam.start();
}

void draw()
{
   if (cam.available())
       cam.read();
       
   image (cam,0,0);
 
}

Re: Processing Video Input Example

PostPosted: Tue Nov 25, 2014 5:32 pm
by BenChang
Video input used as a paintbrush

Code: Select all
import processing.video.*;

Capture cam;

void setup()
{
   size(640,480);
   cam = new Capture(this,160,120);
   cam.start();
}

void draw()
{
   if (cam.available())
       cam.read();
       
   image (cam,mouseX,mouseY);
 
}