scrubbing video

Hans Mittendorf's icon

do we have a patch in which we can scrub video under Max5 or 4?

Hans Mittendorf's icon

what I think of is like opening a quicktime video on the Mac and using the 'knob' underneath the window to scrub back and forth.

Zachary Seldess's icon

Something like this might work for you.

best,
Zachary

Max Patch
Copy patch and select New From Clipboard in Max.

FP's icon

maybe with jump ? look at the jit.qt.movie helpfile.

Gregory Taylor's icon

You've got all kinds of choices for scrubbing a movie:

1. You can choose a specific frame of a movie using the
(wait for it) "frame " message to jit.qt.movie.
Of course, you'll need to know how many "interesting"
frames are in your movie (sending the message "getframecount"
to the jit.qt.movie object and listening at the right outlet
of the object will give you that).

2. You can choose a point in time using the (yes, that's
right) "time " message to jit.qt.movie. But you've
gotta figure out how long the movie is, which involves
getting the QT movie's timescale and length in QT units
and doing some math.

3. You can jump by relative frame position using the
(this is getting tedious) "jump" message.

The choice is yours. The enclosed snippet will tell you
some useful things about a QuickTime movie when you
load it.

Max Patch
Copy patch and select New From Clipboard in Max.

gpvillamil's icon

Here's something weird. I modified the first "scrubber" patch posted in order to continuously update the slider (attached below).

Every time you click on the slider, it actually moves the mouse pointer! So if you repeatedly click on a point on the slider, gradually the mouse pointer is dragged to the right! You can see the current time indicator ratcheting up as this happens.

I did not know UI elements had the power to do this?

Max Patch
Copy patch and select New From Clipboard in Max.

Luis Marques's icon

hello,

For continuously update the slider you have to "gettime" from the jit.qt.movie.

Heres the patch;

Max Patch
Copy patch and select New From Clipboard in Max.

Luis Marques

gpvillamil's icon

Yes, I know, my patch *does* use gettime, if you look at it.

The strange thing that I'm commenting about is that as you click on the slider, the mouse cursor is actually moved by a few pixels to the right every time. Just click repeatedly in the same place, and watch as the position value coming out of the slider gradually increments.

I can guarantee that this is the case, and not that I'm moving the mouse myself, because I'm using a trackpad, and not touching the pad.

Using mousefilter prevents this, but I *do* want to have continuous scrubbing, as in my patch.

Zachary Seldess's icon

Actually gpvillamil, the patch you pasted into your post was just my patch again. You must have mistakenly copied the wrong patch.

But anyways, try this one:

best,
Zachary

Max Patch
Copy patch and select New From Clipboard in Max.

gpvillamil's icon

Whoops, I must have messed up. Anyway, my patch looks much like yours, using gettime to position the slider. (I used t b b and gettime message, your approach is more concise!)

However, even with your patch, the odd behavior occurs. Clicking repeatedly on the same part of the slider gradually moves the mouse cursor to the right.

It's not a big problem, everything else works. It's just a bit strange that the slider object seems to be able to change the mousepos. Maybe it's a Windows thing? It's as if the slider drags the mouse along with it.

Thanks for taking the time to look at this.

Max Patch
Copy patch and select New From Clipboard in Max.

Luis Marques's icon

I'm on Leopard OSX 10.5.6 max 5.0.6, and i tried to clicking repeatedly on the same part of the slider and the slider didn't increment the values... Here is working as expected.

Luis Marques

Zachary Seldess's icon

The mouse does move, you're right. This is because of the way slider works. Notice that the cursor goes invisible when clicking on the slider. It dynamically updates the position of the mouse.

Just switch it out with a multislider and all is well. Here it is:

best,
Zachary

Max Patch
Copy patch and select New From Clipboard in Max.

gpvillamil's icon

That's great! Thank you so much!

Emmanuel Jourdan's icon

gpvillamil wrote on Tue, 17 March 2009 22:24
I did not know UI elements had the power to do this?

Do not underestimate what a UI object can do Thanks for the example. This should be fixed in the forthcoming incremental.

Hans Mittendorf's icon

hi Zachary,
there is a problem with the code. It does not open in a max window.
Could you check it out please?

Hans Mittendorf's icon

thanks that's not bad.

Hans Mittendorf's icon

thanks Gregory, I will work on that.

Hans Mittendorf's icon

hi,
sorry, the patch you have sent does not open in a max window. Could you check what is wrong please?

Hans Mittendorf's icon

hi,
sorry, but I can't see how that will make a srubb.When I move the slider nothing moves with it....I might not get it at this point.
Cheers

Hans Mittendorf's icon

soory, this patch does not open

Hans Mittendorf's icon

yeah, that's it! Cool.

Hans Mittendorf's icon

do you know how to connect a midi controller?

Zachary Seldess's icon

Hans,

I can't tell which patch you're referring to or who you're talking to in several of your last posts. I just checked, and the last patch I included (with the multislider substituting for the slider) pastes into Max without any problem on my machine. Are you still having problems?

best,
Zachary

Hans Mittendorf's icon

sorry for the mess. I realised that a lot was going on and refered to my mail one by one when I came to understand that there was a solution. Sorry.

Max Patch
Copy patch and select New From Clipboard in Max.

I actually have the patch and it works. I just thought that the scrubbing is very difficult and when I place several mouse clicks it does some jumping.
I wanted to create a midi control to the slider to use a fader to scrub but it does not work as yet. I do not know how to substitute the mouse by the controller? Do you? One probably needs to know the length of the movie and asign the slider to a ctlin and a zmap which scales the lenght of the movie.
I have this patch
Thanks so far it is great work you did!

Hans Mittendorf's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Hi Zachary,
just found a midi control which works