3.8. Synchronized playback over a network

Multiple instances of MPlayer can synchronize playback over a network. This is useful for creating "video walls" with multiple screens controlled by different computers. Each MPlayer 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.

The relevant options are -udp-master, -udp-slave, -udp-ip, -udp-port, and -udp-seek-threshold.

If -udp-master is given, MPlayer sends a datagram to -udp-ip (default: 127.0.0.1) on -udp-port (default: 23867) just before playing each frame. The datagram indicates the master's position in the file. If -udp-slave is given, MPlayer listens on -udp-ip/-udp-port and matches the master's position. Setting -udp-ip 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 192.168.0.1 through 192.168.0.8. Assume the first computer is to be the master. Running ifconfig on all the machines lists "Bcast:192.168.0.255". On the master, run:

mplayer -udp-master -udp-ip 192.168.0.255 video1.mpg

On each slave, run:

mplayer -udp-slave -udp-ip 192.168.0.255 videoN.mpg

Seeking, pausing and even playback speed adjustment (see the -input 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.