jit.glue / stretch problems with matrices

Dec 11, 2011 at 10:44pm

jit.glue / stretch problems with matrices

Hello,

I’m trying to use the jit.glue object as sort to combine two videos together. It’s working fine except the videos are stretched and not well displayed with their original dimensions…. Which parameters I should use instead to get the well-proportioned dimensions?

#60621
Dec 12, 2011 at 1:41am

It’s not clear to me where you’re trying to get the proportions right. If it’s the window, they way your patch is setup right now, the concatenated matrices will be stretched to the size of the window, so you’ll need to set the window proportions to match those of the matrix you’re sending to the window. If you want to set the window to an arbitrary size yet still have the video displayed without distortion, you’ll need to use a jit.gl.videoplane object to show the video in the window with black space padding out the rest.

#218181
Dec 12, 2011 at 9:41pm

Unfortunately, when I read the reference and help files related to jit.gl.videplane, I don’t get how to do for padding out the rest.
Also, when I launch a new record, I would like to display a red blinking dot at the bottom of the jit.window as sort to indicate when the record is active. I searched for many ways but didn’t find anything satisfying because the red blinking led, each time I found something, is a component but cannot be displayed within the window… any idea?

#218182
Dec 12, 2011 at 10:00pm

Definitely have a look at the jit.gl.videoplane help file. If you want to create a “record” LED in the window, you’ll need to use some gl geometry. I’d recommend using a jit.gl.gridshape @shape sphere @color 1 0 0 1 and enable/disable it depending on the recording state

Here’s something to get you started. If there’s something you don’t understand, have a look at the reference pages and play around with it.

– Pasted Max Patch, click to expand. –
#218183
Dec 13, 2011 at 10:17pm

That’s much better, but now I have a flickering pictures.
I don’t understand why it does this.

The patch is simple.
When I stike the space bar, it generates a random and unique name. Then, a vidéo is recorded (3 seconds) from the webcam.
Previously to this, I opened the jit.qt.grab component.

Then, whan my video is recorded, it is displayed on the left corner screen while the right displays the current video capture (not recorded)…

#218184
Dec 13, 2011 at 11:16pm

You can’t both send a matrix to the window and use gl.render to do 3D graphics in the window at the same time. This is causing your flickering. There are two ways to display visual information in a window with jitter:

1) send a matrix to the window
2) use OpenGL to render graphics to the window

These two techniques are mutually exclusive. You’re using both. This is a common mistake when starting out with Jitter. Using OpenGL is the most flexible way to display graphics.

#218185

You must be logged in to reply to this topic.