In this tutorial, we will be focused on the display of movies using Apple’s QuickTime video playback tools. We will also learn about using Max’s built-in file browser to find useful video content, and learn a few ways to manipulate movie playback in realtime.
Apple’s QuickTime system is well-known as a movie-playing mechanism, but it also provides software developers with a rich toolbox for playback and manipulation of many types of media content. The QuickTime developer tools were used to create several objects for Max; one of the most important is the imovie
object, which displays video content inside of a patcher. We will use imovie
to load and play videos as well as manipulate the playback speed and playback location. We will also learn to load and switch between videos, opening the door for interactive performance patches.
While the imovie
object provides a lot of functionality for working with video media within Max, the Jitter set of object extensions for Max provide much more. Once you get comfortable with imovie
, you'll find it easy to use its Jitter equivalent jit.qt.movie
, which allows you to not only play video but sent it into the Jitter matrix processing system to dynamically add effects, perform compositing operations, and develop more advanced video-based systems.
This file loads with a number of small patches and one large display area - this should initially be showing a number inside cross-hairs. This display area is actually the imovie
object, and it allows you to embed a QuickTime movie clip directly inside a patcher. The number with crosshairs is a video clip that the object has loaded when we opened the patcher; it's called . We will use this instance of imovie
, along with several control messages, to display and control QuickTime movie playback.
Just above the imovie
object is an array of message
boxes that sends commands to the object. The top four messages provide some basic commands: the message will read in a specified movie file; will cause it to begin playing; will cease playing the file; will remove the current movie from the imovie
object's memory. Once you have disposed of the movie, you can reload it again using the command. Try clicking these message
boxes. Note that begins the movie at the beginning every time you send that message.
Next is a vertical set of five different imovie
object to change the playback speed of the movie clip, where the value means normal (forward) playback. A of will play the movie backwards at normal speed; moves the clip forwards at ½ speed. Start the movie's playback (with the message), then click on the messages to see the alteration. Note that sending the message pauses
the movie where it is. A subsequent message (or any other speed) will pick things up where it left off.
messages. The message tells the
When the movie reaches the end, you can click the toggle
box to turn on looping. Now you can see that the movie, upon reaching its end, will restart at the beginning – running forever.
message again to restart it. However, just to the right of the messages, we can see an alternative to constant restarting: using the message to cause the video file to loop over and over. Click on the
object can also tell us things about the QuickTime movie currently playing. There are many different messages that can be used to query imovie
information; you can find out about them in the reference manual pages. One of the most important pieces of information is the duration
of the movie – the amount of time for a single iteration of a movie’s playback. This could be used to generate a music score, or just set up a display that helps show where we are in the film. In any case, sending the message causes imovie
to send the movie’s duration (in milliseconds) out the leftmost outlet of the object.
The messages we’ve just tried give us basic control of the imovie
object, but having to change the message any time that we want to add a new file would be rather onerous. One option is to change it to a message with no argument; this will open a dialog box
that lets you pick any file on your computer system. However, perhaps the easiest way to add a new movie to your imovie
object is to use the file browser
You can open a file browser window by selecting New File Browser from the File menu. This presents a window with file names, file types, modification dates, and custom tags – all files that Max determined might be useful for your patcher programming.
Displaying “everything” (the default option) may not be that helpful, but if you search for specific files, you can normally zero into the contents you need. For example, in the search box at the top right of the browser, enter in the file suffix
. This is the file extension often used for QuickTime movies; searching for this text will display all of the files with .mov as part of their name.
The browser is also able to do a search based on the type of file you need (rather than just its name). Clear out the search box, then hit the + button to its right. Another pane of search criteria is displayed at the top of the window. The drop-down menu at the left lets you choose the field to search – if we change it to “Kind”, then select “moviefile”, we quickly get the list of all movies, whether using the .mov extension or some other movie identifier. If this is a search you are going to use often, you can add it to the file browser window by clicking on the + button at the bottom of the window; this allows us to save searches for use later.
Now that we have the list of available movies displayed, we can grab a movie by name and drag
it onto the imovie
object to open it. Click on one of the files by name (or any other column, really) and drag it to the patcher window. When you hover over the imovie
object, you should see a blueish border appear in the object – this means that it can be a recipient of the file you are dragging. Releasing the mouse at this point will load the movie file into the imovie
During our first experiments with this patch, we used
messages to determine the speed of playback; we also noted that rates greater than caused forward playback while rates less than caused reverse playback. We are going to use this concept, along with some mouse-tracking, to perform some realtime video scrubbing/scratching.
In the section of the patch labeled 1
, you will see that a metro
is set up to poll a mousestate
object, and the second outlet (the horizontal location of the mouse) is being used. The value is displayed and scaled (through a scale
object) into a value that will range from to (or greater, if your screen is wider than pixels wide). The result is used to create a message that is sent to the imovie
If we turn on the metro
with the toggle
box, we will see the horizontal mouse location being tracked in this portion of the patch. Start the movie (with the message) and turn on looping (with the toggle
box connected to the message). Move the mouse across the screen – you will see it speed up, slow down and reverse direction depending on the current mouse position. Going “through zero” (producing positive numbers that move through zero and back into higher negative numbers) produces the typical scratching function we’ve come to identify as a useful VJ manipulation.
Turn off the metro
in section 1
, and turn on the metro
in section 2
. This small sub-patch is very similar to the first – we are tracking mouse movements and turning them into video playback messages. In this case, we are using the vertical
mouse location to set the current playback position
. In order for this to work correctly, you will need the duration of the current movie, which you can get by clicking on the message box (found just above the selector at the top of the patch).
Once the proper duration has be communicated to our patch, we can see that changes to the vertical mouse position will be scaled to the range imovie
inlet. The imovie
object treats incoming integers as “current position” settings, and the movie will immediately jump to that position.
– (for the "countdown" video) and sent to the
By default, however, once the position is set it will just keep playing at its current speed. The behavior of QuickTime movies is that they are always running at their current rate; if you want to completely control the playback location of the movie, you will need to start by setting the
to . If we do this (using the message box), vertical mouse moves will now allow us to maneuver through the movie in frame-by-frame steps.
Another way that we can control the imovie
output is by loading and switching between several movies. Unlike many other media-related objects, imovie
can load several different movie files, then can use the message to jump among the files to determine which one is active.
The segment of the patch labeled 3
is the area that shows how to load and cue multiple videos. In this case, four files are pulled from the search path and read into the imovie
object through the message
box at the top. Next, we have a key
object watching user keyboard entry; the letters “a”, “s”, “d” and “f” (ASCII , , , and , respectively) are each mapped using the select
object to a statement (followed by a message to restart the video). If you click on the four-part message
box, you can see that the videos have been loaded. Now, using one of the 4 files, type “a”, “s”, “d” or “f” on the keyboard to select the movie you want to display. You can do this as rapidly as you wish; since the movie files are already loaded into the imovie
object, there will be little latency when switching between them.
We’ve focused on the imovie
object, which allows us to play and manipulate video content. In addition to simply playing and stopping movies, we’ve learned to alter the playback speed with messages and with mouse movement; we’ve also learned how to use mouse movement to change the current playback position. Finally, we learned that imovie
can have many movies loaded, and a simple patch can accept keyboard input and perform high-speed movie switching. All of this builds on the simple commands provided by the imovie
Play a QuickTime movie in a patcher window