Master/slave syncing of omxplayer instances over network

pip install omxsync==0.1.1



python module to sync playback of several omxplayer instances

Build Status Code Climate


A tiny python module that syncs omxplayers over the network using sockets and a master/slave configuration. The syncing logic was initialy inspired by the omxplayer-sync implementation, but designed to be easily implementable in your python project (and not as a stand-alone runnable script). It uses python-omxplayer-wrapper to interface with the OMXPlayer process.


First make sure willprice's python-omxplayer-wrapper is installed. Go to for instructions.

On the slave you might need to change your raspi's configuration to allow incoming broadcast messages (syncing happens over a broadcast channel by default):

echo 0 | sudo tee /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts

Finally install the omxsync package

pip install omxsync

Usage - master

from omxplayer import OMXPlayer
from omxsync import Broadcaster

player = OMXPlayer('path/to/video.mp4')
broadcaster = Broadcaster(player, {'verbose': True})

while player.playback_status() != "Stopped":

Usage - slave

from omxplayer import OMXPlayer
from omxsync import Receiver

player = OMXPlayer('path/to/video.mp4')
receiver = Receiver(player, {'verbose': True})

while player.playback_status() != "Stopped":

Advanced Options

Use a custom network port (the broadcaster and receiver must use the same port)

receiver = Receiver(player, {'port': 3001}) # default: 1666
broadcaster = Broadcaster(player, {'port': 3001}) # default: 1666

Use specific remote IP-adresses (instead of broadcasting).

Using '' for the receiver will accept both broadcasted data and data send specifically to the receiver. Using '' on the broadcaster will broadcast the data Alternatively you could send to a specific machine by using the slave's IP address

receiver = Receiver(player, {'host': ''}) # default: ''
broadcaster = Broadcaster(player, {'port': ''}) # default: ''

Specify a custom broadcast interval (in seconds)

broadcaster = Broadcaster(player, {'interval': '5.0'}) # default: 1.0

Custom slave-syncing parameters

Tolerance is the maximum amount of time that the slave is allowed to be ahead of behind on the master before syncing measures will be taken (specified in seconds).

receiver = Receiver(player, {'tolerance': 0.1}) # default: 0.05

Grace time is the amount of time after a sync-action (pause or jump) that the slave will wait before performing any new syncing actions (specified in seconds).

receiver = Receiver(player, {'grace_time': 1.0}) # default: 3.0

Jump ahead time is the amount of time that the slave will jump AHEAD of the master's playback position when slacking behind (or too far ahead). This gives the slave some time to process the (key-)frames for the new position before having to resume playback. (Specifed in seconds.)

receiver = Receiver(player, {'jump_ahead': 2.5}) # default: 3.0