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?
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.
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?
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.
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)...
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.