Actionscript 3 Video Color Sampler Experiment

Actionscript 3 Video Sampler

A while back I published a small Actionscript experiment that sampled colors of video and displayed a matrix of the sampled colors it retrieved. I mentioned that I would be posting a follow-up once I ported all the code to Actionscript 3 and was able to do some interesting experiments with this technique. The current color sampler can give you the rgb code, red channel, green channel, blue channel, hue, saturation and brightness. It took a bit of time, but I have made five different motion treatments generated from my color sampling engine. The port of the color sampler class to Actionscript 3 made a significant difference in terms of performance and offered many more possibilities to what I could attempt. These five experiments are really just scratching the surface of what can be done with this technique - I have already thought of 3 or 4 different methods I would like to create.

Since I have been making a big deal about Nine Inch Nails on this site ever since the Year Zero hoopla, I thought I would use a few music videos from the aforementioned band. I found a few of these videos worked especially well due to their color composition.

I will be posting the full documented code with examples later this week. Until then, please feel free to download the color sampler class. Protected under the GNU Public License.

Update

Since the Flash Player 9.0.115 update, all this work ceased to function. I have updated the underlying code to work in the newest versions of Flash Player, but not this actual work. My apologies.

The Discussion

5 Comments on “Actionscript 3 Video Color Sampler Experiment”

This is a cool idea. I wonder about sampling the HSV values and converting sending them to the background color of the web page, dynamically. It would also be cool to see the loudness values of your program tossed into the mix.


Thats really cool… I’ve been experimenting with this myself. I will publish something shortly, the differance is that mine works with flickr instead of video. Excellent choice of videos by the way ;)


I like your chain visualization the best. It is interesting to see how the peaks and valleys seem to exist in accordance to the positive and negative of the black and white film. Even when it gets an information overload the lines go all crazy. Very cool.


[...] video… Yes, I know, this is a good thing, but it broke my code for this, this, this and this. I have managed to partially fix a couple of them, but this is really my fault as well since the [...]


i have problems

SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: http://www.somerandomdude.net/f/articles/sampler-as3/together.swf cannot access unknown URL. No policy files granted access.
at flash.display::BitmapData/draw()
at VideoColorSamplerFlash/sampleVideo()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at ()
at SetIntervalTimer/onTimer()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()


Comment Love

Leave a comment, have 50 cents donated to a charity.