loading next movie causes a pause

Aug 5, 2010 at 11:25am

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. –
#51653
Aug 5, 2010 at 1:35pm

hello,
loadram and vps tuts from Andrew Benson are your next hours
cheers
hube

#185351
Aug 6, 2010 at 2:08pm

thnx ;)

#185352
Aug 6, 2010 at 5:23pm

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

it is discussed in this thread:

http://cycling74.com/forums/topic.php?id=22108

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.

best
gisela

#185353
Aug 6, 2010 at 8:24pm

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

#185354
Aug 6, 2010 at 10:28pm

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

#185355
Aug 6, 2010 at 10:59pm

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

#185356
Aug 6, 2010 at 11:46pm

here is an interesting document about max performance settings:

http://www.cycling74.com/docs/max5/vignettes/core/scheduler_pane.html

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

http://www.cycling74.com/forums/topic.php?id=660

#185357
Aug 7, 2010 at 2:14am

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.

#185358
Aug 7, 2010 at 9:58pm

“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. –
#185359
Aug 8, 2010 at 12:06am

@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 :)

#185360
Aug 8, 2010 at 12:11am

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

#185361
Aug 8, 2010 at 2:15am

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

#185362
Aug 8, 2010 at 2:27am

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

#185363
Aug 8, 2010 at 8:36pm

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.

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

#185364

You must be logged in to reply to this topic.