Video to light

Open Source software contributions and discussions that supplement or extend the Palette / Light Palette software
Post Reply
tom
Posts: 224
Joined: Thu Jun 26, 2008 5:30 am
Location: The Netherlands

Video to light

Post by tom » Thu Oct 29, 2009 12:25 pm

This app takes a video source and then tranfers it to a light matrix on the desk. In nearly realtime. The choppy framerate makes it alittle unrecognisable but it could be a concept for some abstract realtime video images.

It takes a wee bit of setting up. It needs to be done on a laptop or PC with a webcam attached. Then it's the easiest to use the OLE instead of connection to a desk.

Unzip file
Load up the palette file
Open the matrix utility.
Go to file - grid layout open - and choose "30x20 layout"
The press run
Go to file - grid allocation open - and choose "30x20 allocation"
Press moniter
Open the video to console app.
Select your capture device (if you have more than one) and then press preview.
Then press track
Fiddle around with the sliders until your happy with the colours being tracked. The slider to the right of the output matrix is the overall pixel sensitivity. The output matrix basically works by taking the amount of good pixels in a region and that will trigger the output matrix to light up.
Invert speaks for itself really.
Then press connect to start talking to the OLE

When thats all ready press go live and return to the matrix utility. Now you should be seeing a preview of what it could look like if you have it connected to a real matrix. You can fiddle around with top and bottom levels as well as time settings for more abstract images.

Zip includes:
Matrix Utility (a slightly chopped down version, theres a finished release of this coming fairly soon)
grid setup file (for MU)
grid allocation file (for MU)
Bitmaps folder (MU)
video looks (palette file)
video to console application.

The palette file includes a page of 600 looks. This was the cleanest way of communicating with the console, without having deltas flying all over the place.
Attachments
video to light.rar
(87.35 KiB) Downloaded 93 times
Last edited by tom on Thu Oct 29, 2009 12:32 pm, edited 1 time in total.
Light palette : classic
Nederlands Dans Theater.

"Come forth and thy shalt win eternal happiness", but he came fifth, so he won an electric toaster.

tom
Posts: 224
Joined: Thu Jun 26, 2008 5:30 am
Location: The Netherlands

Re: Video to light

Post by tom » Thu Oct 29, 2009 12:28 pm

Phase 2 in this will be to replace the video app with a max msp app. This gives a decent framerate and resolution, not to mention alot more video options. I havn't managed to get MSP talking to the palette yet though. Searching the help forums hasn't gotten me any closer to sending out telnet commands from MSP. Does anyone use the program much and know how i might get that working?
Light palette : classic
Nederlands Dans Theater.

"Come forth and thy shalt win eternal happiness", but he came fifth, so he won an electric toaster.

User avatar
RobertBell
Posts: 2421
Joined: Fri Oct 12, 2007 1:11 pm
Primary Venue / Use: Other
Where I Am: Horizon Control Inc
Location: On the dark side just north of Toronto
Contact:

Re: Video to light

Post by RobertBell » Thu Oct 29, 2009 2:11 pm

Using subs is nutty. :o

I've only done this with colour mixing fixtures (not just intensities like you have done). It hasn't been documented publicly before this, but you may want to try HC.AttributeSetValue() which, by default, goes to the LIVE buffer (can also go to Blind). What you want to try is a layer in resolution after LIVE called PIXELMAPPER.
Set the pixel mapper alpha/r/g/b to alpha = 255, red = 192, green=127, blue=30 for fixtures 101 to 200
HC.AttributeSetValue("pixelmapper", "101/200", "ARGB", 0xffc07f1e) or
HC.AttributeSetValue("pixelmapper", "101/200", "ARGB", 4290805534)
The last value is a 24bit ARGB value (bit shift each component to its proper ARGB location). Alpha values will resolve with the live cue values where A=255 is opaque and A=0 is transparent, lets cue values shine through.

You can also have a comma separated list of ARGBs (not just the one shown). In the above example, all fixtures (101 through 200) would be red = 192, green=127, blue=30 and the cue value would be squashed. If you listed 10 numbers after "ARGB" (vs. the one shown) then 101 thru 110 would use those values and 111 thru 120 would also use them and so on. You could list all 100 values if you like (which is what I do in the PixelMapper app also posted in this forum).

R
Robert Bell - Product Manager - Horizon Control Inc.

tom
Posts: 224
Joined: Thu Jun 26, 2008 5:30 am
Location: The Netherlands

Re: Video to light

Post by tom » Tue Nov 03, 2009 11:06 am

I've tried it but havn't gotten any response yet. Is there anymore information on the HC.AttributeSetValue() command? Does it still throw out deltas and does it get affected by release?

This is the reason i used looks. So you could have this thing playing in the backround and still edit cues without them being affected by the video playback. Also so you can still use release without affecting the video playback.

It's not the looks slowing the framerate down. It's the loop which analyzes the pixels from the live video feed. I'm nearly convinced that vb is just not capable of doing this in realtime.
Light palette : classic
Nederlands Dans Theater.

"Come forth and thy shalt win eternal happiness", but he came fifth, so he won an electric toaster.

User avatar
RobertBell
Posts: 2421
Joined: Fri Oct 12, 2007 1:11 pm
Primary Venue / Use: Other
Where I Am: Horizon Control Inc
Location: On the dark side just north of Toronto
Contact:

Re: Video to light

Post by RobertBell » Wed Nov 04, 2009 11:58 am

Optimization can be tricky. How long are you sitting between loops or are you going full balls out? i.e., if you are done sampling the last pixel, do you go right to sampling the first again? At what point to you build the string to send and how many pixels in that string? You want to reduce the number of sends as each telnet string can only be processed in one engine loop (50 hz).
ARGB allows you to only send the command once with a tightly packed array of values. Highly optimized.
And it does not delta the fixtures. It's like DMX-In channel control or look resolution.
Robert Bell - Product Manager - Horizon Control Inc.

tom
Posts: 224
Joined: Thu Jun 26, 2008 5:30 am
Location: The Netherlands

Re: Video to light

Post by tom » Fri Nov 06, 2009 7:54 pm

The loop checks the rgba level of a pixel, splits the string returned, sorts out the numbers, then based on the filter either says yes or no. Once it's finished, depending on other toggles it sends out commands. But even when i only do this loop on it's own it still fairly slows everything down. The loop runs constantly, once it's finished it does it's other stuff and then runs straight again.
Light palette : classic
Nederlands Dans Theater.

"Come forth and thy shalt win eternal happiness", but he came fifth, so he won an electric toaster.

User avatar
RobertBell
Posts: 2421
Joined: Fri Oct 12, 2007 1:11 pm
Primary Venue / Use: Other
Where I Am: Horizon Control Inc
Location: On the dark side just north of Toronto
Contact:

Re: Video to light

Post by RobertBell » Sun Nov 08, 2009 10:54 pm

tom wrote: Once it's finished, depending on other toggles it sends out commands.
How many pixel's per command? What does a sample string look like (say) for 10 pixels?
Robert Bell - Product Manager - Horizon Control Inc.

Post Reply