[MPlayer-users] Synchronizing multiple instance of Mplayer over the network

cbreak cbreak at the-color-black.net
Fri Nov 28 17:18:07 CET 2008


On 27.11.2008, at 20:44, Lehni wrote:

> Hello,
>
> I am trying to find out if it is possible to synchronize the playback
> of muplitple instances of Mplayer on multiple machines across the
> network. I would like to create a video wall based on HD resolution
> video files. Each of these files is a part of a video of an even
> higher resolution, and each would be played back by its own dedicated
> machine.
>
> I imagine one machine would be declared master (server), the other
> slaves (clients) for the time signal.
>
> Is there such a feature? If not, how hard would it be to implement it?

As the other replies already indicated, there's currently no such  
feature available.

I did however write a script to at least allow syncronized starting of  
movies. The script is started by cron or via ssh, and opens a port  
where mplayer lists for commands. MPlayer is started paused.

To start all at the same time, use something like

 > Controller
#!/bin/sh

PORT=44444
SERVERS="alpha.local beta.local gamma.local"
for DN in $SERVERS
do
	echo pause | nc $DN $PORT
done

 > Player Side
#!/bin/sh

PORT=44444
FIFO=rconmp.fifo

function tempname
{
	# Generate an unlikely to be used name
	dd if=/dev/random bs=16 count=1 | openssl base64 | sed -e "s/\///g" - 
e "s/=//g"
}

FIFOFILE=${FIFO}.$(tempname)

mkfifo ${FIFOFILE}
nc -kl ${PORT} > ${FIFOFILE} &
NCPID=$!
echo pause | mplayer -slave -idle -input file=${FIFOFILE} "$@"
echo killing nc with PID ${NCPID}
kill ${NCPID}
rm ${FIFOFILE}



Needless to say that this will not address potential desync issues  
that arise during playback. Also, you should not do that on anything  
but a secure local lan, since an open pipe to mplayer gives a lot of  
rights.

You can try to resync it by quitting all players and starting them  
synchronized again, or by skipping to a known position (like the  
start). An other possibility, if you use a playlist, is to feed that  
playlist piecewise to the player via the network, which would again  
give synchronisation points.

cbreak


>
> Is anyone else interested in working on this?
>
> Best,
>
> Lehni
>
>
> _______________________________________________
> MPlayer-users mailing list
> MPlayer-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users




More information about the MPlayer-users mailing list