Detect end of video

asmarquis's icon

can anyone tell me how i could get maxx to tell me when a clip has started and where it ends? I'd like to have one video end then send a bang that starts another one, starting a chain reaction that follows that trend.

Christopher Dobrian's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Send a 'getduration' message to jit.qt.movie to get the movie's duration (in timescale units) out the right outlet. Then send regular 'gettime' messages to jit.qt.movie to get the current time (in timescale units), and compare it to the duration with a >= object. Something like this:

--Chris

asmarquis's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Hey. not really sure how to implement this with my patch. Think you could take a look and see what i'm missing?

Christopher Dobrian's icon

Sorry, I don't really have time to help you debug, etc., but here are a couple of quick suggestions. 1) You need to use the right outlet of unpack (from the read message) not the left outlet. 2) You need to store the duration value (for example in the right inlet of a >= object, and then you need to compare each time report to that value to see if it has equalled or surpassed the known duration of the movie. When that test comes out true (1), you will use a select 1 object to detect that, and that can trigger the next thing to happen, such as choosing a new movie to read in.