Mon Nov 12 21:02:21 CET 2007
CAVE-MPlayer (formerly "cmplayer") is a patch for MPlayer which lets you synchronise several players running on several computers connected to a dedicated LAN.
So, every host will load a movie from its internal storage media, and all of them will be played at the same speed, i.e., all of them will start at the same moment and after some time, all of them will have played the same number of frames at a fixed framerate.
Note:There is already some unrelated projects named "cmplayer":
Note: Since 2010, Jason Holt <jholt [at] google.com> patches for UDP network synchronization were included in mplayer code, so CAVE-Mplayer is no longer needed.
Working. Not too much tested.
Alpha status. Mostly for developers.
Should work on any Linux/Unix system, tested on:
First, you need to get the system clocks of all of your computers synchronised. I'd sugest to use NTP for this purpose.
According to my experiments, using NTP, gettimeofday() returns differences below 40 ms; which is good enough for the usual 25 fps movies:
# sec:usec = 1069231417:653136 # sec:usec = 1069231417:653433 # sec:usec = 1069231417:656074 # sec:usec = 1069231417:653073 # sec:usec = 1069231417:653663 # sec:usec = 1069231417:653664
Then, you need a modified mplayer which can:
So, in short, cave-mplayer project patches mplayer so it will be able to behave this way.
We will use a computer as "master". This computer will take care of
Before the "READY" packet, the "mplayer" instance has its movie loaded and ready to play.
So, when the master gets "N" answers, it broadcasts a "start" command which includes the start date, computed as the next second boundary unless the difference is less than 0.5 sec, if this is the case, another second will be added.
When every "mplayer" instance receives the "start" command, compares the start time with current time, and returns "OK" or "Too Late" packet.
If is ok, "mplayer" will wait for start time, and then is will play the file.
This patch will make mplayer open a network port (when "-udp" option is used), and no access control is done on it; so, you should use this only on trusted networks.
The same applies to "cmplayers" auxiliar program