[MPlayer-users] Synching multiple instances of Mplayer on serparate machines

Morris Beverly morrisb at avpresentations.com
Fri Apr 27 21:03:29 CEST 2007


paul paradiso wrote:
> Hello,
> I am looking to find a way to sync multiple instances of mplayer running on
> different machines, and possibly on the same machine, with a dual-head
> card,  I saw a conversion in the archives a few months back that seemed to
> assure me that it would be possible, but didn't see much more.  The videos
> will have the same number of frames and the machines will be on a gigabit
> lan.  If anyone had a little advice on how to get started or where to look
> for further information, that would be fantastic.
>   

You can definitely do this, but you will definitely have to write some 
code yourself.

Basically you create a server in whatever you write your software in, 
java, python, etc.  You start mplayer within that server, in slave mode, 
with a stream open to send commands to it via mplayer's stdin.  You send 
slave commands to the server, which then passes them on to the running 
instance of mplayer via that stream. 

I wrote a small server in java that starts up mplayer in slave mode and 
waits for commands from the network to forward to mplayer via a 
printstream connected to mplayers stdin.  The server essentially echos 
the command to the printstream.  The controller program sits on another 
machine & sends out the appropriate slave mode commands over the network 
to the server.  I don't know what a realistic limit is on the number of 
mplayer servers you can control, but I can do 3 without any problem.

My code is too much of a mess for anyone else to read, but if I ever get 
it cleaned up, I'll post it.  You can email me directly with specific 
questions, but I don't really have time to write a piece of skeleton 
code right now - sorry.  If you'd be writing it in java, google: "java 
process builder stdin".

Here's a link to a  piece of code that shows how to start mplayer in 
java & get a printstream to send commands over:
http://www.avpresentations.com/code/java_mplayer_control_example.txt

good luck,

morris






More information about the MPlayer-users mailing list