Forums > Jitter

loading next movie causes a pause

August 5, 2010 | 11:25 am

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. –

August 5, 2010 | 1:35 pm

loadram and vps tuts from Andrew Benson are your next hours

August 6, 2010 | 2:08 pm

thnx ;)

August 6, 2010 | 5:23 pm

Andrew Benson is good, but you will have 5-10 double frames
after switching.

it is discussed in this thread:

still no solution for this problem ….

perhaps someone found a way to switch directly from
one movie to another without hickup od double frames.

the only way i found out is to copy all the clips into
one, save it with the quicktime player and jump into
this single movie.


August 6, 2010 | 8:24 pm

heelo gisela, thank you for your reply

it is really weird the fact that there is no solution for this, I will continue my research and post the results.. if I found any

August 6, 2010 | 10:28 pm

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.)

August 6, 2010 | 10:59 pm

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

it’s odd the fact that sometimes it doesn’t do any stops and it is very smooth when switching to the next video, other times it stops a bit, you only notice if you are really focused on the video.

i’m running a MBP 15", 2.8ghz, 4GB ram, Max 5

August 6, 2010 | 11:46 pm

here is an interesting document about max performance settings:

and this post is a must read, I have just started:

August 7, 2010 | 2:14 am

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 object when you drag-’n'-drop a new movie file into the dropfile object, rather than by the ‘read’ message going into the object. The amount of time it takes the 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.

August 7, 2010 | 9:58 pm

"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. –

August 8, 2010 | 12:06 am

@seejayjames nice workaround!! pitty it doesn’t work with sound, but anyway, it’s a really cool effect and I’m sure I will use this is the near future!
Thanks a lot!
My research continues :)

August 8, 2010 | 12:11 am

@Christopher Dobrian, I think I can understand what you mean, but I can’t figure out the way to do it :

August 8, 2010 | 2:15 am

@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" (

@visualiz, I think Chris Dobrian means this: when you send a "read" message to, it loads the file. When it’s completed loading, it sends the message "read 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.

August 8, 2010 | 2:27 am

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

August 8, 2010 | 8:36 pm

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

Anyway, fun stuff to mess with… as always with Max :)

Viewing 15 posts - 1 through 15 (of 15 total)