Video Grid. Too slow in playing live

    Mar 13 2012 | 3:35 pm
    Dear everybody, I am a music composer, so I am kind of new to the jitter evironment. I made the following patch, but I have a problem: I want to project it live, but the patch run really slow...I use a Mac OS X 10.5.8 with a processor of 2.4 GHz Intel Core 2 Duo and the videocard from the computer (Intel GMA X3100). Is there any solution to make the patch less heavier or so? Otherwise if I record it and do not play t live, do you think I will reduce this problem?
    The patch works with 5 videos numbered from 0 to 4 and 1 named whiteBackground which I use to fade out. bye elisa

    • Mar 13 2012 | 4:39 pm
      Check the links for jitter optimisation in this thread:
    • Mar 13 2012 | 4:57 pm
      ok I will do it thx a lot
    • Mar 13 2012 | 9:09 pm
      i'm not much of a jitter user, but just looking at your patch, it looks like you should use jit.scissors. you also could figure a way of having a white background without the need to play a movie of a white background... maybe just create a 4-plane matrix filled with high values (127 or 1.0) and xfade with that...
    • Mar 16 2012 | 1:12 pm
      @ Terry: the 4 plane matrix is a good option in order to remove 12 videos...but the jit.scissors and jit.glue I do not think is a good solution because it just cut a part of a video. What I want is to display 12 videos in a grid. What I think would help is to reduce the video size. Now I am using and jit matrix with a size of 1280x720 and then resize every single video to match a 1/12th of the matrix. Is there a way of using directly videos of 320x240 and placing them in the matrix without resizing them?
    • Mar 16 2012 | 3:11 pm
      You can use jit.glue for that:
    • Mar 16 2012 | 4:48 pm
      Playing 12 720p video at the same time, even with a powerful machine, will be pretty heavy. Your best bet will be to resize all of your videos to be much smaller and use @adapt 1 on the objects. Figure out how many actual pixels from each video will be on the display from each video and resize accordingly. Ask yourself if you actually need all 12 videos to be independent in realtime. Another thing that would probably help speed is to use OpenGL videoplanes to create your grid instead of the jit.matrix stuff. You might also get some ideas from the Jitter Recipe called TinyVideo:
    • Mar 17 2012 | 6:26 pm
      yes, definitely resize the videos beforehand. If you have 5 videos at 1280 x 720, and the eventual size on the screen is going to be 320 x 240, you are essentially processing 12 times as many pixels as you need for each one. If you have 12 independent ones (even if they are the same video, if you want independent controls like position in the movie or speed or FX, you need a separate object for each). Then you're up to processing 144 times as many pixels as you need...if I'm reading your posts right. I doubt there are ANY machines today which could actually do that at 30 fps...?
      Anyway, if you know the eventual output size, resize beforehand if possible. Using @adapt 1 is great for videos coming in with unknown resolutions. But if you do know them, you can avoid even that, which takes a bit of processing too.
      The optimization tips should be studied and implemented for any project of significant processing load. And the OpenGL videoplanes (or texturing on gridshapes etc.) should be explored will take some time, but you'll see that this is a much more interesting, flexible, and powerful way to project can open up a 3D space for your videos instead of always being on a flat plane, not to mention using lots of other shapes instead of planes for projection!
    • Mar 23 2012 | 1:24 pm
      I left the forum on the side because I was busy with the music aspect of it. I will check your suggestions and see if I come trhrough it. And update the forum conversation.
      thx a lot
    • Apr 13 2012 | 9:26 am
      @ seejayjames the problem is that the final size is 1280x720. i am trying to find a command that can place the videos with a resolution of 320x240 into the matrix (size1280x720). Any help?
    • Apr 13 2012 | 9:53 am
      Resize your videos to 320x240 and either use jit.glue to stick them together to make your 1280x720, or for better performance, but maybe more advanced GL patching render your 320x240 videos onto which can then be positioned in your 1280x720 render context window.
    • Apr 13 2012 | 9:57 am
      ok this is what I am checking now
    • Apr 13 2012 | 11:00 am
      This is a very rough primitive version of it But I have a problem with the sizes....the, and the jit.window are all sized to 1280x720 pixels, and the movies at 320x240...So i should have a grid of 4 by 3 videos, which is not the case...where is my mistake?
    • Apr 13 2012 | 1:04 pm
      You just have to resize your videoplanes, they always initiate at context size. Here's a rough idea of what you want, but you'll have to fiddle about with scale and position to correct my bad calculations for yourself. There's the videoplane aspect thing to account for, so for a full size 4:3 video the scale would need to be 1.333 1. so you either need to rescale in those proportions or use things like transform_reset on the videoplane or ortho on the render. I'm sure someone else can explain it all better than me...
    • Apr 13 2012 | 7:24 pm
      you might want to try the new object for this.
      it allows you to provide relative coordinates for the corners, and allows you to preserve the aspect ratio of the incoming matrix.
    • Apr 19 2012 | 2:24 pm
      How do the position 0. 0. 0. arguments relate to the jit.window coordinates? I do not find the relation between the values for precise positioning. For exemple: placing a video of 320 x240 in a rectangle of 80x60 in the left upper corner of a jit.window 320 x 240 (meaning that it will occupying the rectangle 0 0 80 60 of the jit.window), and a second video of 320 x240 in a rectangle of 80x60 occupying the jit.window rectangle 80 60 160 120 of the same jit.window. In other words, where is e.g. position 1. 1. 1. located? Thanks