[MPlayer-DOCS] r32066 - in trunk: AUTHORS DOCS/man/en/mplayer.1 DOCS/xml/en/usage.xml Makefile cfg-mplayer.h help/help_mp-en.h mplayer.c udp_sync.c udp_sync.h

reimar subversion at mplayerhq.hu
Wed Sep 8 07:29:05 CEST 2010

Author: reimar
Date: Wed Sep  8 07:29:05 2010
New Revision: 32066

Add synchronization of multiple MPlayer instances over UDP.
Patch by Jason Holt [jholt google com]


Changes in other areas also in this revision:

Modified: trunk/DOCS/man/en/mplayer.1
--- trunk/DOCS/man/en/mplayer.1	Wed Sep  8 01:46:14 2010	(r32065)
+++ trunk/DOCS/man/en/mplayer.1	Wed Sep  8 07:29:05 2010	(r32066)
@@ -1195,6 +1195,34 @@ Skip <sec> seconds after every frame.
 The normal framerate of the movie is kept, so playback is accelerated.
 Since MPlayer can only seek to the next keyframe this may be inexact.
+.B \-udp\-ip <ip>
+Sets the destination address for datagrams sent by the \-udp\-master.
+Setting it to a broadcast address allows multiple slaves having the same
+broadcast address to sync to the master (default:
+.B \-udp\-master
+Send a datagram to \-udp\-ip on \-udp\-port just before playing each frame.
+The datagram indicates the master's position in the file.
+.B \-udp\-port <port>
+Sets the destination port for datagrams sent by the \-udp\-master, and the
+port a \-udp\-slave listens on (default: 23867).
+.B \-udp\-seek\-threshold <sec>
+When the master seeks, the slave has to decide whether to seek as
+well, or to catch up by decoding frames without pausing between frames.
+If the master is more than <sec> seconds away from the
+slave, the slave seeks.
+Otherwise, it "runs" to catch up or waits for the master.
+This should almost always be left at its default setting of 1 second.
+.B \-udp\-slave
+Listen on \-udp\-port and match the master's position.

Modified: trunk/DOCS/xml/en/usage.xml
--- trunk/DOCS/xml/en/usage.xml	Wed Sep  8 01:46:14 2010	(r32065)
+++ trunk/DOCS/xml/en/usage.xml	Wed Sep  8 07:29:05 2010	(r32066)
@@ -686,9 +686,69 @@ change the default operation which is to
 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+<sect1 id="networksync" xreflabel="Network Synchronized Playback">
+<title>Synchronized playback over a network</title>
+Multiple instances of <application>MPlayer</application> can synchronize
+playback over a network. This is useful for creating "video walls" with
+multiple screens controlled by different computers. Each
+<application>MPlayer</application> instance can
+play a different video, but they all will try to stay at the same time offset
+in the file. It is recommended but not necessary to encode the video files
+using the same codec and parameters.
+<para>The relevant options are <option>-udp-master</option>,
+  <option>-udp-slave</option>, <option>-udp-ip</option>,
+  <option>-udp-port</option>, and <option>-udp-seek-threshold</option>.
+If <option>-udp-master</option> is given, <application>MPlayer</application>
+sends a datagram to <option>-udp-ip</option> (default:
+on <option>-udp-port</option> (default: 23867) just before playing each frame.
+The datagram indicates the master's position in the file. If
+<option>-udp-slave</option> is given, <application>MPlayer</application> listens on
+and matches the master's position. Setting <option>-udp-ip</option> to the
+master's broadcast address allows multiple slaves having the same broadcast
+address to sync to the master.  Note that this feature assumes an
+ethernet-like low-latency network connection.  Your mileage may vary on high
+latency networks.
+For example, assume 8 computers are on a network, with IP addresses
+through Assume the first computer is to be the master. Running
+ifconfig on all the machines lists "Bcast:". On the master, run:
+mplayer -udp-master -udp-ip video1.mpg
+On each slave, run:
+mplayer -udp-slave videoN.mpg
+Seeking, pausing and even playback speed adjustment (see the
+<option>-input</option> option) can be done on the master, and all the slaves
+will follow. When the master exits, it sends out a "bye" message which causes
+the slaves to exit as well.
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
 <sect1 id="advaudio-surround">
 <title>Surround/Multichannel playback</title>

Modified: trunk/help/help_mp-en.h
--- trunk/help/help_mp-en.h	Wed Sep  8 01:46:14 2010	(r32065)
+++ trunk/help/help_mp-en.h	Wed Sep  8 07:29:05 2010	(r32066)
@@ -180,6 +180,8 @@ static const char help_text[]=
 #define MSGTR_DvdnavNavSpuClutChange "DVDNAV Event: Nav SPU CLUT Change\n"
 #define MSGTR_DvdnavNavSeekDone "DVDNAV Event: Nav Seek Done\n"
 #define MSGTR_MenuCall "Menu call\n"
+#define MSGTR_MasterQuit "Option -udp_slave: exiting because master exited\n"
+#define MSGTR_InvalidIP "Option -udp-ip: invalid IP address\n"
 // --- edit decision lists
 #define MSGTR_EdlOutOfMem "Can't allocate enough memory to hold EDL data.\n"

More information about the MPlayer-DOCS mailing list