How to ensure Jit.movie Loops in Sync playing two video files on 2 computers

matthew Munson's icon

We are playing two video files through Jit.movie each on two laptops. Each laptop will be playing these two files on two displays. We will initiate playback by simply counting to 3 and hitting spacebar on each machine simultaneously to the best of our abilities.. We noticed that when the patch loops the videos go out of sync. I am trying to correct for this. To ensure everything plays in sync, I want to use "@loopreport 1" to reset the videos, each occurring on one of the patches for two videos. I think I have an idea how to proceed but wanted to appeal for any guidance to be sure. I thought to use "first-bang" to rule out the initial bang output by Jit.movie. I thought to use each subsequent right output of first-bang to reset the videos. However, there needs to be a means of resetting first bang. Could this potentially be done by the right output of first-bang itself? The patch I have here is somewhat updated. I hope what I say is clear.

DISPLAYS_TOggle.maxpat
Max Patch

Source Audio's icon

to at least start them together link 2 laptops using

something like midi or OSC and send play messages from one of them.

If videos are not really long that might work to some extent.

only 1 laptop needs to loop, the other has to restart when 1st one restarts the loop.

one can loop also without loop set, just use loopreport bang to start video again.

Could be run thru some gate to disable looping when needed....

matthew Munson's icon

Excuse me, I might have something wrong but there is an initial bang sent out by the right outlet of jit.movie when the video starts. I thought that bang would need to be distinguished from with something like first-bang. It is necessary to filter out that bang or else the video will play prematurely. I respect your guidance but I seem to be confused. Please if you could clarify.

Source Audio's icon

you overlooked loop 0 in my example.

I suggested to trigger all movies no matter on which laptop without looping.

but you also need a filter for other messages

like reading file

matthew Munson's icon

Excuse me, I am using something similar to what you showed me. However, when playing the same video there is a noticeable difference in playback. I am looking for loopnotify with the sel object to trigger the "read" message to restart both videos simultaneously. For some reason there is a lag between videos.

Any help would be great.

DISPLAYS_TOggle_LOOPNOTIFY_streamline2.maxpat
Max Patch

Source Audio's icon

it makes no sense to reread video file,

and even less to expect that read -> autoplay should play videos in sync.

matthew Munson's icon

I am now triggering message saying : pos 0, start.

This appears to work. I guess this was an easy solution. Thanks for all the help.

Source Audio's icon

that sure works better.

If you need to read and then start 2 different videos together,

wait till read =1 gets reported from both jit.movie players.

makes sure that both players are ready to start.