One of my overall goals is to find a way to databend live video. I’m sure there’s a way to do it with Processing and Pure:Data but I’m not yet proficient in those programs so they’re out of the question for now. In the meantime I thought to try and hack the Echobender script to databend my webcam images.
tonyg provides a great tutorial on how to convert live webcam images into audio, which I’ve used as a starting point for my hack.
The process for making it works is as follows:
Images from the webcam are saved to the computer
These are converted to a .bmp file then renamed to a .raw file
Sox applies an audio effect to the .raw file
The .raw file is converted back to a .bmp then to a .jpg
The updated webcam image is displayed to a window and updated once every second
Sound overly complicated? It probably is. Like the Echobender script you’ll need ImageMagick and Sox but we’ll also be using Webcam, which you can install via “sudo apt-get install webcam”
If you haven’t already, create a file called “.webcamrc” in your home directory (/home/yourusername) and enter this text into it:
[grab]
delay = 0
text = “”
[ftp]
local = 1
tmp = uploading.jpg
file = webcam.jpg
dir = .
debug = 1
Now create a file called grabframe, place it in your home directory and fill it with this:
To start things running, open up three terminal instances:
In shell number one, run “webcam”.
In shell number two, run “while true; do ./grabframe ; done”.
In shell number three, run “display -update 1 output.jpg”
Voila!
I know it’s quite slow, but I haven’t yet found a way to update faster and it’ll still be restricted by the time it takes Sox/ImageMagick to perform their conversions.
Thanks again to tonyg, Imbecil and Mez for their help and inspiration
Myself and Mez recently finished a script called Echobender that automatically databends images.
Click to download
To use it you’ll need:
A computer with Linux installed. I don’t have a Windows or Mac PC so I can’t test it on those
Sox. On Ubuntu you can install it via “sudo apt-get install sox”
Convert, which is part of ImageMagick. On Ubuntu you can install it via “apt-get install imagemagick”
Once you have those installed just execute ./echobender.sh from the terminal and then drop a .jpg or .bmp file into it. The output will be in a folder called “echo”.
If you look closely at the script you can see a way to convert any data into an image! I’ll leave that one up to you… Here’s the source code for all those interested:
I'm a software artist based online and in Birmingham, UK. The work that I do looks at interesting ways in which to interpret data, technology and how it relates to art and the creative sector. For more information look at the Projects page or found out more About Me