Record video (via webcam) and play back the previous recorded video

Shaun the Sheep's icon

Hello everyone,

this week we had a 3-day course in Max and now we have to do an assignment, so I'm really new to this.

We wanted to do the following project:
If someone presses the space bar, a funny video will be shown on one half of the screen. During that, the webcam will record the reaction of the person watching the video and on the other half of the screen the person can see the reaction of the previous person.
Now we're a little bit lost at the point how to play back the previous recorded video...does anybody have a tutorial or anything? Cause this is certainly nothing new and shouldn't be too difficult, but we couldn't find anything helpful yet.

Thanks a lot!!

MrMaarten's icon

I am not behind my max computer right now, but from the top of my head:

To split your problem up in a few pieces you will need:
- get a live feed with jit.qt.grab
- connect the live feed to a jit.qt.record
- have a jit.qt.movie to play the video on the left and one to play the reaction on the right
To get to views, either:
- connect each jit.qt.movie to a pwindow and arrange it as desired and work in presentation mode
or
- set up a GL rendercontext and send each video to a [jit.gl.videoplane @transform_reset 2] and then give scale and position messages to get it right
-set the right dimensions of both the grab and the recorder
- set the folder where the video's will be recorded
This can be done with [opendialog fold] and the store that folder in a message box (right inlet, bang on the left inlet to get the folder.
- make a name for the video that will be recorded.
This can be done by combining the path with a base name you set and store in an other message box and an increment of the name which can be done with a counter of with retrieving the time
- you set the camera to record when the video plays and stop recording when the video is done
starting record is done by "write name" and stopping with "stop"
jit.qt.movie reports out the right outlet succes of reading a file and reports when it is done with playing a file. Look in the helpfile or reference for the exact way
- store the name of the video that has been recorded previously (again in a message box) and send the name with a [prepend read] to player (a [jit.qt.movie] @adapt 1 @loop 0 @autostart 1])

Hope this helps!