Movement activates video

Oct 23, 2010 at 12:59pm

Movement activates video

Hi,
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.

Thanks!

#52889
Oct 23, 2010 at 6:52pm

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. –
#190248
Oct 23, 2010 at 7:52pm

MIB,
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 :)

#190249
Oct 23, 2010 at 8:56pm

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. –
#190250
Oct 23, 2010 at 10:08pm

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

#190251
Oct 23, 2010 at 10:12pm

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…

#190252
Oct 26, 2010 at 1:22pm

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

#190253
Nov 30, 2010 at 8:23am

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?

#190254
Nov 30, 2010 at 5:38pm

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.

#190255

You must be logged in to reply to this topic.