Mixing More Than Two Videos Together?!?

MissMAX's icon

Hi,
Been working on this patch, but I now wanna mix/overlap 6 videos, instead of 2.
Is this possible, if so, does anyone know how?

As always, thanks in advance for any help/advice.

MissMax

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

Here it is...

Rob Ramirez's icon

i'm assuming you mean 6 simultaneous video feeds overlaid on top of each other.
the easiest way to do this is with an opengl context, and blending multiple jit.gl.videoplanes

the patch below gets you started with 3. you should probably turn the qt.movie -> jit.gl.videoplane into an abstraction, for easy editing and duplicating.

if your framerate is low, you will have to make some optimizations. searching the forum for "video optimizations" or something similar will yield much information.

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

also, check out the jit.gl.hap external, for an efficient video playback alternative:
https://cycling74.com/tools/jit-gl-hap/

MissMAX's icon

Thanks for your help.
I'll have a play around with your patch, it looks great!
MissMax :)

pdunandf's icon

the patch above mixing 3 videaos is great stuff for me, thanks, but I'm having a problem with image quality which seems to be falling very, very low

I'll be really thankfull for any indication

Rob Ramirez's icon

set @adapt 1 on each of the qt.movie objects to tell it to output frames at the resolution of the input file.

pdunandf's icon

sorry for another stupid question: can you help with saving the resulting video mix on disk with, eg, jit.qt.record or any other video recording object?

thx a lot

Tobias Rosenberger's icon

jit.gl.asyncread

pdunandf's icon

thank you very much for this indication: if I may, I don't know where to position this in the patch. Should I replace the jit.qt.record with it?
I'm afraid I don't really understand what I doing... sorry

Roman Thilenius's icon

what wrong with cascading jit.op or jit.alphablend?

pdunandf's icon

tanks a lot, Roman, for these excellent propositons for mixing video; however I still have two problems: image quality in fulscreen mode and getting results on disk properely

Roman Thilenius's icon

i am not sure if they are excellent, maybe it gets tricky with 19 sources. with 16 or 32, however, it seems the most straightforward solution.

about CPU consumption, no idea.

and of course it will all only work when the frames are in sync. and if they are not, i would suggest to change that per channel _before mixing.

-110

Rob Ramirez's icon

just throw an gl.asyncread in your patch, and add it to the context you want to readback from. it will output a matrix for every draw-frame.

you will also have to disable @fsaa on your jit.window, if it's enabled.

many people capturing render contexts will advise using a 3rd party software, like iShowU.
the Syphon recorder is a free one that works quite well, when used with the syphon externals.

searching the forum for syphon will yield plenty of examples of its usage.

pdunandf's icon

thank you so much, dear Rob and Roman, your quick replies are highly appreciated
however, I'h having a hard time understanding you guys - the patch I'm working on was primarily musical, and I now understand that I need to learn quite lot on jitter, quicktime, gl

'hope I'll manage

best

pdf

can you explaine the -110 signature?

Cian Finlay's icon

Rob you have saved me on so many different forum posts. I feel like im chasing your past around :P

So if anyone has come to this post- for me for some reason in Rob's patch, the alpha blending wouldnt work. So instead, i just mapped R, G, B, and A, and that becomes the opacity.

I dont know why my videoplanes are being unfreindly and reserved in regards to their alphas... (sounds saucy)
But in any case, if you were struggling to get it to work, i hope this helps

THANKS ROB