Live Video delay in GL?
Dec 3, 2008 at 10:19pm
Live Video delay in GL?
I have made a crude patch where I have scissored up an image from a web cam into 12 sections 3 x 4. Then I have put a delay of different amounts on each of them and then glued them back together and sent it to a jit.window. The result is if you move you get cut up into bits then slowly come back together again.
Now in the pursuit of performance I am looking into jit.gl.videoplane ect
My question is, is it possible to split up my video, delay individual sections and re-composite all in GL? or should I just try and texturise all the outputs of the delays to a jit.gl.videoplane. This leaves the scissoring in software.
I have little GL experience as you can probably tell. I fear that the positioning of the sections could be a drag. I intend to make a bigger version of this with many more sections.
Your guidance much appreciated as ever
Dec 8, 2008 at 10:29am
Doing video delays in GL is a bit of a pain in the ass, and may not save you as much effort as you’d think.
I made a patch that had a 5×5 grid of sections each of which could be individually delayed different amounts, or zoomed into particular sections of the overall image.
Another way to do the same thing is to create a single 3d matrix with # frames of delay that you then query for your frame that is going to go into the particular section of your grid.
If you added more frames of delay, you’d need to add more textures to the first model, whereas the second model always uses the same number of textures.
Both models are an improvement over sending individual frames to each section and trying to keep track of content at a particular position per node. It is better to create a single master matrix that can be pulled from, or a single GL set of textures that can be similarly referenced.
Dec 8, 2008 at 8:07pm
I did this fine with jit.glue but performance was not good and had a massive delay even on the video that had no delay
If anybody can be botherd to have a look at my embryonic attempt to stitch my video back together here is an basic example with obviously wrong numbers in the texture messages
This uses a 640 x 480 web cam as the input with jit.qt.grab (Mac)
Dec 8, 2008 at 8:23pm
Try using jit.gl.videoplane @transform_reset 2. This will normalize
On Mon, Dec 8, 2008 at 12:07 PM, Carl Rohumaa
Dec 8, 2008 at 11:37pm
Thanks Wes that really simplified things for me.
So for others who are as hair-brained as myself if you use @transform_reset 2 then it dose not really matter what the input is as it will be normalised to [-1, 1] x [-1, 1]
So in my patch the twelve chunks of video come in 3 rows and 4 columns, so the scaling on the videoplane needs to be .25 = (4 div 1) wide and .33 = (3 div 1) across
The positions work like this too. -0.75 is the far left 0.75 is far right 0.66 is top 0.0 is middle and -0.66 is bottom taking into account the size of the object
My patch corrected.
You must be logged in to reply to this topic.