Sort grid of videos depending on color

bYou's icon

I am lost with this one...

I am trying to sort a 6x7 grid of videos (jit.glued together) so that their position in the matrix changes overtime depending on the dominant color in the video (lightest to darkest, top to bottom). I can't seem to find anything to point me in the right direction. Any advice?

Floating Point's icon
Max Patch
Copy patch and select New From Clipboard in Max.

here's one approach using the coll sort function to resort indices, which are then used as messages to control the router object:

you might get into trouble with 42 video sources though...

phiol's icon

does this work ?

Max Patch
Copy patch and select New From Clipboard in Max.

bYou's icon

Floating Pt-- this works great, thank you! I am worried about glue not holding up well with 42 videos (I should also mention that theyre live streams I am rendering to matrices, so extra intensity).

Phiol-- this is beautiful, but somehow doesnt seem to be positioning the videos dark-->light via the noise matrix. It seems to be going in order (tex1, 2, 3, 4) top to bottom. I tried switching around some of the texture names and they still behaved that way. Maybe it is my ignorance? Am I doing something wrong?

Floating Point's icon

actually the live streams might be less demanding given they don't require disk access... but just out of curiosity how do you intend to get 42 video streams into your computer?

phiol's icon

hi BYOU

1st of all, how did you plan your setup for 42 live cams ?

2nd this must be done with gl. there is no way you'll get this working with CPU matrices.
even with gl, 42 live streams is heavy demand.

here is the patch again
yes the ramp color white 2 black will choose texture 1 to 7

Max Patch
Copy patch and select New From Clipboard in Max.

also , I have a module I quickly put together that you could use for your 42 textures. Actually no, because you will be using live stream
but here it is anyways for future reference. It's polybuffer's sister jit.gl.polytexture

TConnors's icon

Hi Phiol,

Simple question. In your 2nd posted patch (exactly as it is configured) should the videos be playing or would they be static images?

phiol's icon

Hello TCONNORS

jit.gl.texture is being used , so still images were intended for this example ;-)

phiol

bYou's icon

hey phiol,

coming back to this late! thank you for all your help. there doesnt seem to be anything in the dropbox though-- would you mind sending to me? :)

bYou's icon

by the way.. to get the IP cam feeds Im using a modified version of the security player by Vade: http://abstrakt.vade.info/?p=80

phiol's icon
bYou's icon

I need the sorting of dark to light, and floating points coll sort example works well for that. Is there a way to use gl texture in this case instead of jit.glue? It is too intense for CPU to handle

Max Patch
Copy patch and select New From Clipboard in Max.

phiol's icon

here is a gl version of jit.scissors , (glue's brother)
I'm sure you'll figure out how to do a glue version ;-)