Calling multiple instances of one movie

genekogan's icon

Hi all,

I am trying to create a patch in which I can play multiple instances of the same movie file simultaneously, all at different points in the movie. I need to do this in the most efficient way possible, so loading multiple copies of the same movie wouldn't cut it--I need something that is like a buffer for video so that I can call the same buffer in multiple windows at once. Does anyone have an idea for this? Thanks!

genekogan's icon

Also, just as an addendum so people know the context of this question and my goal for this patch. I am playing 6 movies at once, and each of the 6 movies is playing data from one of 20 video files on my computer. It is possible that more than 1 of my 6 movies are playing different segments of the same video file simultaneously, and I am constantly changing what video files the movies are referring to.

The first way I tried this is to have 6 movies, and every time I switch one, it just reads in the new video file. But it's much too slow to constantly read in the same files over and over, so I'd like to load all 20 of the possible videos at once and keep them in ram. But in order to be able to play the same file up to six times at once, it would require me to load 6 copies of each of the 20 files for 120 movies in ram at once. This is obviously impractical. How can I do this where I just have each of the 20 movies loaded once?

Rob Ramirez's icon

this can be done with the forward object.
check out the multi-head example patch:
Max5/examples/jitter-examples/video/quicktime/jit.qt.movie-multi-head.maxpat

genekogan's icon

This looks really promising. The only thing is it seems to discard the audio. Since it's switching back and forth, would it be difficult to get the audio of both at once?

doubi73's icon

This solution lags a lot for me. 2 instances is ok. More it is not ok.
Solution ?

ctrlzjones's icon

>Solution ?

Take it to GL-land

David Flaherty's icon

jit.qt.movie-multi-head.maxpat appears not to be included in the latest versions of Max. Is there anywhere online where I might access old examples, or, barring that, does anybody have a copy lying around that they could post here? I'm attempting to get multiple tiled instances of the same movie playing at different points in the movie and jit.gl.multiple seems to not be the correct object...

Wil's icon

What about jitter-examples/video/movie/PolyMovie/Poly~ForMovies

//

or with jit.gl.node

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

//

or jit.multiple

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

TFL's icon

In examples given by WIL, poly~ForMovies or the jit.gl.node options both load the same movie multiple times, which isn't really ideal. The jit.multiple approach uses only one jit.movie, providing only a single play head.

An approach that I assumed viable is to use [jit.gl.polymovie] (new from Max 8.2), since, according to Rob Ramirez, "the object supports multi-head playback from a single source for added video madness." But the problem is that the multi-head example provided in the help patch doesn't use the same source, and I just tried to use a single source as two separate targets, but since they share the same texture output name, you cannot scrub them independently from each other:

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

So at this point I'm not sure if Robs statement is simply wrong, or if I approach the problem in the wrong way.

This said, I vaguely remember an example from Rob from not too far from now (maybe 2-3 years ago?) that would use a single [jit.movie] for multiple play heads, but I couldn't find it. I tried something with [grab] but, still, no luck.

Rob Ramirez's icon

multi-head playback from a single source meaning a single object (jit.polymovie). to grab multi-heads from a single jit.movie you would have to use viddll engine and loadram

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

TFL's icon

oh, I didn't get the nuance, thanks.

I also didn't get that loadram would load the frames in the RAM and not the VRAM.

Here is small example getting it working with output_texture enabled (requires to manually bang the jit.gl destination with @automatic 0):

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