Video Delay in Jitter


    Feb 22 2007 | 9:19 pm
    Hi - I am trying to create an adjustable real-time delay from a video input. Maybe up to 10 seconds long at the maximum.
    I am wondering if there is a simple way to do this? Perhaps something similar to the tapin~/ tapout~ objects in Max/MSP?
    What I have researched so far leads me to think this isn't really a simple process... does anyone know otherwise?
    Thanks,
    Andrew

    • Feb 22 2007 | 9:35 pm
      A 3d matrix way of doing it, which I find to be more reliable than the matrixset object. I have this configured for 0-127 frames of delay. Just substitute values or variables for "127" maximum or "128" frames as necessary to have a different defined buffer of sorts.
      Paste this:
    • Feb 24 2007 | 3:10 am
      Where do I paste this?
    • Feb 24 2007 | 3:15 am
      In your patch. It's magic!
      wes
      On 2/23/07, Andrew Douglas wrote: > > Where do I paste this? > >
    • Feb 24 2007 | 9:02 pm
      Magic! Brilliance. Thankyou very much! Andrew D
    • Dec 18 2007 | 3:16 am
      The abstraction for video delay works great, but I don't understand the theory behind it
      Could someone help explain the patch to me ? Why does the change of the third number in "srcdimstart 0 0 $1" or in "srcdimend 319 239 $1" affect the delayed video ?
      (I thought the 3rd number only deal with dimension but not with time.)
      What does the formula in the expr object do ?
      Could someone help ? Thanks.
      Quote: KillingFrenzy wrote on Thu, 22 February 2007 14:35 ---------------------------------------------------- > A 3d matrix way of doing it, which I find to be more reliable than the matrixset object. > I have this configured for 0-127 frames of delay. Just substitute values or variables for "127" maximum or "128" frames as necessary to have a different defined buffer of sorts. > > Paste this: > > > #P outlet 37 209 15 0; > #P inlet 157 2 15 0; > #P inlet 37 1 15 0; > #P window setfont "Sans Serif" 9.; > #P window linecount 1; > #P newex 56 125 111 9109513 expr (($i1+128)-$i2)%128; > #P newex 37 171 215 9109513 jit.matrix 4 char 320 240 @usesrcdim 1 @adapt 0; > #P message 56 149 182 9109513 srcdimstart 0 0 $1 , srcdimend 319 239 $1; > #N counter 0 0 127; > #X flags 0 0; > #P newobj 56 57 73 9109513 counter 0 0 127; > #P message 56 79 182 9109513 dstdimstart 0 0 $1 , dstdimend 319 239 $1; > #P newex 37 101 233 9109513 jit.matrix 4 char 320 240 128 @usedstdim 1 @interp 0; > #P newex 37 29 29 9109513 t l b; > #P comment 2 3 30 9109513 Delay; > #B color 10; > #P comment 55 209 69 9109513 Delayed Video; > #P comment 54 1 52 9109513 Input Video; > #P comment 175 1 64 9109513 Delay Amount; > #P user panel 1 0 34 20; > #X brgb 0 0 0; > #X frgb 0 0 0; > #X border 1; > #X rounded 0; > #X shadow 0; > #X done; > #P connect 13 0 11 1; > #P connect 11 0 9 0; > #P connect 8 0 11 0; > #P connect 8 0 7 0; > #P connect 5 1 8 0; > #P connect 10 0 14 0; > #P connect 9 0 10 0; > #P connect 6 0 10 0; > #P lcolor 13; > #P connect 5 0 6 0; > #P lcolor 13; > #P connect 7 0 6 0; > #P connect 12 0 5 0; > #P window clipboard copycount 15; > ----------------------------------------------------
    • Dec 18 2007 | 3:32 am
      time is a dimension.
      Think of the video frames as pictures.
      with two dimensions you have X and Y, the familiar picture/photo/2D image you are used to seeing.
      With a Z axis, you can have LAYERS of frames ( think of stacking photos on top of one another - each additional STACKED FRAME is another increment in the Z axis)
      The last srcdimstart 0 0 $1 refers to the LAYER, in this case, the STACK number, or, WHAT particular frame in our stack that we want.
      -- for more :
      Imagine what you could do if you varied that number per EACH output of a frame? You could make a single output frame that has MULTIPLE frames within it, one frame as a conglomerate of many different moments in time (hint: wesley smiths xray.timecube object :) )
      On Dec 17, 2007, at 10:16 PM, Cheng Chien-Wen wrote:
      > > The abstraction for video delay works great, but I don't understand > the theory behind it > > Could someone help explain the patch to me ? Why does the change of > the third number in "srcdimstart 0 0 $1" or in "srcdimend 319 239 > $1" affect the delayed video ? > > (I thought the 3rd number only deal with dimension but not with time.) > > What does the formula in the expr object do ? > > Could someone help ? Thanks. > > Quote: KillingFrenzy wrote on Thu, 22 February 2007 14:35 > ---------------------------------------------------- >> A 3d matrix way of doing it, which I find to be more reliable than >> the matrixset object. >> I have this configured for 0-127 frames of delay. Just substitute >> values or variables for "127" maximum or "128" frames as necessary >> to have a different defined buffer of sorts. >> >> Paste this: >> >> >> #P outlet 37 209 15 0; >> #P inlet 157 2 15 0; >> #P inlet 37 1 15 0; >> #P window setfont "Sans Serif" 9.; >> #P window linecount 1; >> #P newex 56 125 111 9109513 expr (($i1+128)-$i2)%128; >> #P newex 37 171 215 9109513 jit.matrix 4 char 320 240 @usesrcdim 1 >> @adapt 0; >> #P message 56 149 182 9109513 srcdimstart 0 0 $1 , srcdimend 319 >> 239 $1; >> #N counter 0 0 127; >> #X flags 0 0; >> #P newobj 56 57 73 9109513 counter 0 0 127; >> #P message 56 79 182 9109513 dstdimstart 0 0 $1 , dstdimend 319 >> 239 $1; >> #P newex 37 101 233 9109513 jit.matrix 4 char 320 240 128 >> @usedstdim 1 @interp 0; >> #P newex 37 29 29 9109513 t l b; >> #P comment 2 3 30 9109513 Delay; >> #B color 10; >> #P comment 55 209 69 9109513 Delayed Video; >> #P comment 54 1 52 9109513 Input Video; >> #P comment 175 1 64 9109513 Delay Amount; >> #P user panel 1 0 34 20; >> #X brgb 0 0 0; >> #X frgb 0 0 0; >> #X border 1; >> #X rounded 0; >> #X shadow 0; >> #X done; >> #P connect 13 0 11 1; >> #P connect 11 0 9 0; >> #P connect 8 0 11 0; >> #P connect 8 0 7 0; >> #P connect 5 1 8 0; >> #P connect 10 0 14 0; >> #P connect 9 0 10 0; >> #P connect 6 0 10 0; >> #P lcolor 13; >> #P connect 5 0 6 0; >> #P lcolor 13; >> #P connect 7 0 6 0; >> #P connect 12 0 5 0; >> #P window clipboard copycount 15; >> > ---------------------------------------------------- > >
    • Dec 18 2007 | 3:51 pm
      Hi, Vade,
      Now I understand a little bit better.
      Thank you very much for the explanation.
    • Feb 15 2012 | 9:05 pm
      Hello
      I wanted to adapt the patch from above with the ability to change the resolution. Maybe it is obvious and simple but i am not getting what i am doing wrong right now... Help is very appreciated! Here is my adapted version:
    • Dec 13 2017 | 3:27 am
      Well. I don't really see how this works. I plugged my webcam feed into the suggested solution here and the output was just black. It did not work for me.
    • Dec 13 2017 | 6:16 pm
      much more efficient modern version using gl-textures:
    • Dec 13 2017 | 10:07 pm
      This is even more confusing. What i'm looking for in terms of output is a video or frame that is delayed by a controllable amount. I don't know what this patch does, and I don't see where the video out would be. Perhaps we're not on the same page.
    • Dec 14 2017 | 12:01 am
      well you gotta take some time to examine and understand the patch in order to make what you want. here's more what you're looking for. check out the jit.matrixset help file, in the video-delay tab for further explanation of this functionality. jit.gl.textureset.js is a replacement for jit.matrixset that processes textures rather than matrices, and is therefore more efficient.
    • May 08 2018 | 11:51 am
      Hey Rob,
      thanks for the great delay tool. I'm a beginner with jitter / openGL and I' wondering what kind of "data" the output of your js is. If i send it into the jit.world everything works fine, but I can't seem to get it to work with any other jitter/gl objects like videoplane etc. Any tips or help for that?
      Thanks in advance!
      Hoowdie
    • May 08 2018 | 2:35 pm
      it's simply jit_gl_texture messages. any jit.gl object that accepts texture input (e.g. videoplane) should be able to handle and display the output.
      post your patch if you can't get it to work.