Forums > Jitter

Movement activates video

October 23, 2010 | 12:59 pm

I’m trying to set up a patch that plays a video depending on the amount of movement detected. I tried looking through the cv library, no luck yet.
I just need help figuring out the basic set up.

No movement=static/black screen-no play
Little movement=cut signal or 5fps
More movement=smooth signal
MORE movement=fast forward in the video-24fps

Note that it will be connected to .mov/.avi files. No live streams.


October 23, 2010 | 6:52 pm

Try this for starters. Should get you going on the movement part… no cv library required if you are just interested in amount of movement…

— Pasted Max Patch, click to expand. —
October 23, 2010 | 7:52 pm

Thanks for your reply.
Unfortunately, I’m still a little lost.
I’m trying to set up an interactive installation. Basically a video will play based on the motion we make with our body coming in from a live stream (will not be displayed).

Sorry for the misunderstanding, I’m looking into the patch you sent. – thank you very much btw :)

October 23, 2010 | 8:56 pm

as I said, it’s a starting point. I am only displaying the video so you can see what happens at each step of the analysis. You certainly don’t want all those pwindows in your patch. Very inefficient!!!!
I quickly hooked up jit.qt.grab and added a simple video playback thing to it. right now the amount of movement controls the rate of the video, but you could certainly do many different things…
no movement, video stops (doesn’t go to black, yet); if every pixel were to be ON, the video would play back at 6 times the original speed…
Hope this clarifies things a bit more.

— Pasted Max Patch, click to expand. —
October 23, 2010 | 10:08 pm

OMG. You are-AWESOME!!
thank you SO MUCH MIB!

October 23, 2010 | 10:12 pm

yeah that’s great—love the chain of events, very clear, thanks!

in my experience .avi files play back really clunky, .mov is probably your best bet. so when you’re testing, .avi might give unexpected results (choppiness) and because you’re testing movie rate, it might throw you for a loop…

October 26, 2010 | 1:22 pm

Thank you ‘seejayjames’ for the fyi. I will put that into consideration.

November 30, 2010 | 8:23 am

awesome work and help.

I had a question though, I looked at your example posted, bare with me im a rookie. I was wondering if there was a way to have the movement not play the video but stop it? Also while im here, if there was a way so to delay the time it takes for the motion to interfere with the video?

November 30, 2010 | 5:38 pm

have a look at the [scale] object towards the bottom of the patch. it scales the amount of movement to the rate of the video. play with those numbers and it should be easy to make the video stop when there is movement. TIP: you probably don’t want to scale the movement from 0. to 1. since 1. would be every single pixel in the matrix set to ON. maybe something like [scale 0. 0.2 3. 0.] would be better. this would mean that if there is NO movement the video plays back at 3 times the speed and if 0.2 (or 20%) of the pixels are ON the video is stopped… you probably also want to [clip] your values unless you are ok with the possibility of the video running backwards if the movement is more than 0.2.

to do the delay, have a look at the objects [delay] and [pipe]. I would guess [pipe] is the one you want here since it deals with numbers and lists and [delay] only handles bangs.

Viewing 9 posts - 1 through 9 (of 9 total)

Forums > Jitter