Golan Levin and Collaborators

Flong Blog + News

Free Video Delay in Processing

14 October 2011 / code, pedagogy

Here is a simple, free video delay program, made in Processing v.1.5.1, which I created for a student. The length of the delay is currently set to 100 frames, or approximately 3 seconds. Art students considering to use it should familiarize themselves with classic video delay work, such as Dan Graham’s “Video Delay Room” (1974).

// Video Delay in Processing
import processing.video.*;
Capture myCap;
int capW = 320;
int capH = 240;
 
int nDelayFrames = 100; // about 3 seconds
int currentFrame = nDelayFrames-1;
PImage frames[];
 
void setup() {
  size (640, 480);
  myCap = new Capture(this, capW, capH);
  frames = new PImage[nDelayFrames];
  for (int i=0; i<nDelayFrames; i++) {
    frames[i] = createImage(capW, capH, ARGB);
  }
}
 
void draw() {
  if (myCap.available()) {
    myCap.read();
    frames[currentFrame].loadPixels();
    arrayCopy (myCap.pixels, frames[currentFrame].pixels);
    frames[currentFrame].updatePixels();
    currentFrame = (currentFrame-1 + nDelayFrames) % nDelayFrames;
  }
  image (frames[currentFrame], 0, 0, width, height);
}

Comments are closed.

« Prev post:
» Next post: