time-stretch (live) video?

sascha pohflepp's icon

hi there

what's the best way to time-stretch video in jitter, coming either
from a file or (ideally) from jit.qt.grab ?

cheers
sascha

www.blinksandbuttons.net
blog.plugimi.com

Gary Lee Nelson's icon
jonathan lee marcus's icon

yes it is possible for live video, but you might want to think
through this some more.

if video is a series of still images, what does it mean to time
stretch video? does it mean to throttle the flow of frames? this will
cause a delay from real-time and the longer you want the slow down,
the more memory you will need. eventually you'll have to stop or
speed up the video. in fact, if you want to 'speed up' live video,
you'll either have to start with a delay or build a time machine (not
possible until Max 8.0 comes out around 2057). either way you will
need to make a video buffer.

another issue is what happens between frames. if you just slow down a
video, slow down the flow of frames, it will look choppy. the easiest
solution i can think of is to create some sort of fade between
successive frames the lasts as long as the time between frames.

you can make a video buffer with jit.matrix, jit.matrixset, an array
of jit.matrix objects in javascript, or an array of jit.gl.texture
objects in javascript. i'm sure there are other ways. maybe an array
of matrices or textures in a poly~?

best,
jonathan

On Oct 24, 2006, at 7:51 AM, Gary Lee Nelson wrote:

> Use rate message to jit.qt.movie for file. Not sure it would be
> possible with live video.
>
>
> On 10/24/06 6:45 AM, "sascha pohflepp" wrote:
>
>>
>> hi there
>>
>> what's the best way to time-stretch video in jitter, coming either
>> from a file or (ideally) from jit.qt.grab ?
>>
>>
>> cheers
>> sascha
>>

jitter mailing list
jitter@cycling74.com
https://cycling74.com/mailman/listinfo/jitter

Johnny deKam's icon

the simplest way to timestretch frames which are being displayed
slower than realtime (as jonathan says 'fade between successive
frames' ) is to use jit.slide or you can also try the jsinterpframes-example.patexample patch.

there is also a gl shader (gpu) version of jit.slide located in
shaders folder for those so inclined.

i would also plug 'tap.jit.delay' abstraction in the Tap Tools
Collection which is a convenient way to make a delay buffer (just
specify N frames of delay) on its own it just delays the output,
(doesn't allow you to manipulate the buffer) - however its an
excellent example of how to use and control jit.matrixset.

-- deKam

> another issue is what happens between frames. if you just slow down
> a video, slow down the flow of frames, it will look choppy. the
> easiest solution i can think of is to create some sort of fade
> between successive frames the lasts as long as the time between
> frames.
>
> you can make a video buffer with jit.matrix, jit.matrixset, an
> array of jit.matrix objects in javascript, or an array of
> jit.gl.texture objects in javascript. i'm sure there are other
> ways. maybe an array of matrices or textures in a poly~?
>
> best,
> jonathan

connord@media.mit.edu's icon

Hi Sascha!

Sorry, I dont know the answer to this off the top of my head... Just saying hi and whatnot. I did not know that you posted in this forum ;-)

As for time-stretching... I wonder if Max can exploit the time-stretching features found in Quicktime 7. Open a movie or audio file and then press apple+k (on a Mac, not sure on Windows) and you will get options for pitch shifting audio as well as time-stretching audio/video.

Seeing as Max/Jitter and Quicktime are good buddies (^_^) maybe this functionality is exposed in Max/Jitter - if it's not perhaps we can ask the developers to add it in a future version.

Next time we meet we should have a Max hacking session I really want to come to Berlin in January). It's where I spend most of my time ;-)

Connor