Working with Videos

Using video footage is an easy way to add dynamic layers to an interactive project scene. And processing video is the basis of modern computer-generated video art. This chapter will cover the basic and advanced topics on playing, layering, and processing videos in the openFrameworks projects:

  • Playing a video file
  • Processing video frames
  • Radial and horizontal slit-scan effects
  • Processing a live video from the camera
  • The video synthesizer
  • Using image sequences

Codes and executables for Windows, openFrameworks 0.074, Visual Studio Express 2010 C++: Download

Vertical lines

This example reads the colors of center horizontal line pixels of a video frame
and draws vertical lines with the corresponding colors.

 05-Video/02-VideoVerticals

Replacing Colors

This example replaces the colors of a video frame using random-generated replacing table.

05-Video/03-VideoReplacingColors

Radial slit-scan effect

This is an implementation of a circular version of the slit-scan effect,
which can be called “radial slit-scan”. The mouse position will define the center where a portion of new frame is drawn. The other pixels (x, y) are filled using the older frames, where the frame’s “oldness” depends on the distance between mouse
position and (x, y).

05-Video/04-VideoSlitScan

Video Synthesizer

This is a video synthesizer, combining live video from camera and prerecorded video.
It use colors of live video pixels for shifting pixels of the prerecorded video. Actually, this is well-known “displacement” video effect.

Before running the example, connect web camera to your PC. (If you use laptop with built-in webcam, then most probably it will works by itself.)

05-Video/05-VideoCameraSynth

Using image sequence

This example demontrates how to work with image sequence. It overlays images with alpha channel (wool cloud) over background-layer video (elephant). Also it demontrates how to use Perlin noise for “random-like” moving wool cloud.

05-Video/06-VideoImageSequence

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s