[MPlayer-dev-eng] [PATCH] Network synchronized playback using UDP

Jason Holt jholt at google.com
Fri Mar 20 03:37:08 CET 2009


> I just prefer synchronization as NTP can achieve, down to a few ms, rather
> than
> master-slave synchronization as in this patch that is subject to
> network latencies.


An NTP-based solution could be pretty neat, and could avoid network latency
problems as you suggest.  The master would essentially declare what should
happen when, with plenty of advance warning, and the slaves would do their
duty on time.

My solution's advantage is that it's much simpler, and gets seek, pause and
speed adjustments basically for free, whereas I would expect an NTP-based
solution would have to handle each of those behaviors specifically.

In most applications, I would expect network latency to be under 5ms -- the
screens typically will all be in view of some group of humans, so there's a
good chance there's a low latency network connecting them.


Yes... this patch does not address audio sync.
> I think one should at least consider audio sync to ensure the proposed
> solution
> will be expandable.


I'm having a hard time thinking of why we'd need multiple sets of audio
channels available.  I suppose you could have videos of people talking to
each other, or something cool like that.  For such an application, the
precision offered by my patch and reasonable network latency would probably
be sufficient.

In addition, seeking is not a reliable way to sync video either, as
> its precision could
> be beyond several seconds, if not more, depending of the video.


The slaves only seek when they get more than epsilon away from the master.
I added that feature later to account for slaves that couldn't keep up with
the master, so that they wouldn't just keep drifting further and further
behind.  But having them seek allowed me to control the master and have the
slaves follow along, which has turned out to be a really popular feature for
my video wall -- I have an IR remote sitting out that lets people pause,
rewind, fast forward, go frame by frame, and even change the frame rate.
That required no extra code on the slaves: they just follow wherever the
master is.

So seeking is an added bonus that allows navigating through the video and
keeping bogged slaves from getting behind, not the fundamental mechanism for
keeping everyone in sync.



More information about the MPlayer-dev-eng mailing list