You need to play multiple videos simultaneously and each video on its own display device. The videos need to be synchronized so that they start at the same instant. In this solution we will discuss syncing 3 videos, but the process of syncing any number of videos is the same. Assume the videos are named Video-A, Video-B and Video-C.
IMPORTANT - Make sure the program for set to Multi-Screen mode. Multi-Screen mode allows multiple screens to load and play simultaneously. Go to Behavior > Screens Mode. Clicking this menu item will toggle the mode between Single-Screen and Multi-Screen mode.
Synchronizing videos has some special considerations. Unlike a hardware solution that can cost thousands, a computer can only do one thing at a time (or a few things at a time depending on how your CPU is threaded). When you Play a video with Videomill, it has several tasks to perform:
If you do not pre-load a video before starting Play, Video Mill will automatically do the Load first. The Load tasks take time, so to sync multiple videos, you may need to separate the Load and Play tasks. You can Load all videos first. Then once all loads are completed, start the Play operation. This will improve the sync of your videos.
When you Load a video, it is opened on the drawing surface of the Media Screen at the first frame of the video (assuming you set it to start play at the beginning). There may be cases when you want the Media Screen to be blank after Load. The easiest way to achieve that is to make the first few frames of the video a simple black background. Or you can make it a Title screen for the video.
The first step is to preload all the Media Screens before we begin playing. In the Automator, we create a script to load the videos (Listing 1). The time it takes to complete this pre-load script depends on several factors: The size/resolution of the videos (in megabytes and video width,height); The speed of your computer hardware (CPU, RAM memory and disk speed); Display device characteristics; other processes running on the computer that consume resources, etc.
Listing 1. Pre-load videos A-CScript: Pre-load videos A-C Id: 706545749 Steps: 1. Load (Video-A) 2. Load (Video-B) 3. Load (Video-C)
Once all the preloads are complete, when you start playback, the videos should start in-sync. The script in Listing 2 will start the 3 Plays simultaneously. The Offset time applied to a step, tells Videomill to execute a step, x seconds after the Script begins to run. 'Offset=:00' means execute immediately when the script starts. If you don't apply Offsets, the videos will play sequentially like a standard playlist.
Listing 2. Play videos A-CScript: Play videos A-C Id: 647772154 Steps: 1. Play (Video-A), Offset: :00 2. Play (Video-B), Offset: :00 3. Play (Video-C), Offset: :00
Each computer system has a limit on the number of simultaneous videos it can play. Depending of the system speed characteristics, one video may take under 5% of CPU (or 10% or more). Once the CPU utilization maxes out near 100%, videos will begin dropping frames to keep up (giving the videos a stuttered appearance). The only way to know the maximum number of videos you computer can play simultaneously, is to test it and watch the CPU utilization in the windows task manager. There are also some "Performance Tips" at that link for squeezing extra performance from your computer.
To coordinate the above scripts, we need use a master script to run them (Listing 3). The Delay(:05) step allows time for the videos to complete loading. You can adjust that number of seconds up or down based on how loading performs on your system.
Listing 3. Master PreLoad and Play A-CScript: Master PreLoad and Play A-C Id: 1694711896 Steps: 1. Run Script (Pre-load videos A-C) 2. Delay (:05) 3. Run Script (Play videos A-C)
You may want to sync playback between 2 (or more) computers. In that case, you would duplicate the above scripts on Computer2 (C2 Listing 4-6). Assume the videos on C2 are named Video-D, Video-E and Video-F.
Scripts on Computer2 (C2).
Listing 4. Pre-load videos D-FScript: Pre-load videos D-F Id: 2023637069 Steps: 1. Load (Video-D) 2. Load (Video-E) 3. Load (Video-F)
Listing 5. Play videos D-FScript: Play videos D-F Id: 535504733 Steps: 1. Play (Video-D), Offset: :00 2. Play (Video-E), Offset: :00 3. Play (Video-F), Offset: :00
Listing 6. Master PreLoad and Play D-FScript: Master PreLoad and Play D-F Id: 968301763 Steps: 1. Run Script (Pre-load videos D-F) 2. Delay (:05) 3. Run Script (Play videos D-F)
Now that we have similar Videomill setups on Computers C1 and C2, we need to send a command to C2 to start when C1 starts.
So on C1, we revise 'Master PreLoad and Play A-C' Script (Listing 7). We added a Start Ext.Program (IPC Sendto) command. That sends an IPC command to VideoMill on C2 to run the script with Id=968301763 (Runscript 968301763).
Listing 7. Master PreLoad and Play A-C (revised)Script: Master PreLoad and Play A-C Id: 1694711896 Steps: 1. Start Ext.Program (IPC Sendto: VideoMill on C2), Var: Runscript 968301763 2. Run Script (Pre-load videos A-C) 3. Delay (:05) 4. Run Script (Play videos A-C)
The IPC setup for this 2 Computer solution is shown in Figure 2. Your IP addresses will vary of course. The default port number for Videomill is 52011 but you can change the port if that port is already in use on your system.
For More Information
Figure 3 shows the IPC Client Editor for the Remote Client (bottom left) in Figure 2.