Processing Video Input Example

Moderator: BenChang

Processing Video Input Example

Postby BenChang » Tue Nov 25, 2014 5:31 pm

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);
 
}
User avatar
BenChang
 
Posts: 176
Joined: Mon Jan 17, 2011 4:48 pm

Re: Processing Video Input Example

Postby BenChang » Tue Nov 25, 2014 5:32 pm

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);
 
}
User avatar
BenChang
 
Posts: 176
Joined: Mon Jan 17, 2011 4:48 pm


Return to Art and Animation

Who is online

Users browsing this forum: No registered users and 1 guest

cron