loading next movie causes a pause

I am building a video player application, and this is the patch where I have the videos being played and crossfaded.

The thing I would like to know if it is possible to solve is, when the next video is loaded, the previous video pauses for less then a second and then the cross fade starts. It is a picky issue but it is hitting my eyes everytime I load a new video.

Any help on this will be very apreciated

— Pasted Max Patch, click to expand. —

Copy all of the following text. Then, in Max, select New From Clipboard.

yep if you can do it, put them all into one movie and jump frames. totally dead-on instant in my experience—I did hours of testing with a movie that has 400-frame chunks, running alongside precisely-timed audio (bpm 120). Locked perfectly. Changing the audio rate along with the movie rate all the time, no problems at all. (No audio in the movie, it was separate… changing movie rate with audio in the movie can behave strangely, so I had sfplay~ running instead.)

Without having really tested your patch or having read all the links in this thread, I’ll just comment that you might want to try making everything be triggered by the ‘read’ message that comes out of the right outlet of the jit.qt.movie object when you drag-‘n’-drop a new movie file into the dropfile object, rather than by the ‘read’ message going into the jit.qt.movie object. The amount of time it takes the jit.qt.movie file to read the movie in from the hard drive and begin to play it is "unknowable", so if you wait till it actually tells you it’s ready you might get better results.

"putting them all into one single movie is not an option because I need them to crossfade when I switch to the next movie."

You can do a workaround for this using a jit.xfade-with-itself bit. When you send a new frame command for jumping around, it delays it while the xfade gets to maximum (and playback now looks faded from the frame "reverb"), sends the new frame number, then the xfade ramps back down. Tweak the timings to suit. I made the ramps linear but it would work better if it was rounded at the top like an exponential curve, as jit.xfade doesn’t seem to work linearly (there’s a big difference in the range 0.9 to 0.99 versus 0.0 to 0.09, for example).

At the very least, the jit.xfade-with-itself is a simple way to get some fun echoey effects in your visuals :)

— Pasted Max Patch, click to expand. —

Copy all of the following text. Then, in Max, select New From Clipboard.

@seejayjames, your jit.xfade-with-itself patch is very clever. Just for the record, thought I’d mention that it does the same job as the Auvi object "au.tween" (http://auvi-software.com)

@visualiz, I think Chris Dobrian means this: when you send a "read" message to jit.qt.movie, it loads the file. When it’s completed loading, it sends the message "read xxxx.mov 1" out its right outlet. If you are crossfading, you could delay the start of the crossfade until you are sure that this message appeared out the right outlet. A "route read" object might be useful.

@Kurt, endeed, now I got it, I was being confused by the fact that when a message "read" is sent to the jit.qt.movie it starts the playback automatically. But now I understand that I can turn on the metro just after the video being totally loaded.

thanks! yep I found that little trick way back on the Forums (where else?) and have made some good use of it. Looks very cool for that dream-like effect.

I was thinking about the sound—you could do a similar hack with spigot~ instead of the regular jit.qt.movie volume (set @vol 0.) Grab the audio with spigot~ and split it into two streams, going into different channels of a matrix~. When you jump a frame, gate the audio through tapin~/tapout~ of the right length (so the last audio before frame-jumping has an echo) and then cross-fade that with the new audio. You’d need to tweak the tapin~/tapout~ lengths and amount of feedback to match the frame-jumping transition time, but it should be doable.