Synchronize multiple MF players RRS feed

  • Question

  • I'm developing an application to play one or more video files across one or more screens. The videos need to be played back perfectly synchronised; think of a single video split into multiple files and each file needs to be displayed on a separate screen.  I wrote a simple media foundation player with an output node for each screen and an input node for each video file within the same playback topology and it works well.

    The application however is limited by the number of outputs on the computer. To support more screens, I'm thinking of running multiple players on more than one machine. The problem here is synchronisation across machines. I've thought long and hard about this but can't seem to come up with any reliable way to synchronize the MF players.

    I initially thought of creating a single time source object to act like a server and have the other MF players use this time source in their presentation clocks. I've read through the MSDN documentation and I can't think of a way of having the application access a remote time source object. I should also mention here that the players need only support playback and looping through a playlist. There's no need for seeking, stopping or pausing, so I don't think the players need to have control over the time source, but simply retrieve the time. Is this possible, and in the unlikely (at least to my mind) case it is, how would I go about implementing this?

    The other option is to have a single player, like what I currently have, running in a single machine. Thus a single presentation clock would be in use to ensure synchronisation. The player would then access a media sink on a remote machine rather than a local machine. This might be more stupid than the previous idea, but hey, that's all I could come up with :). Is there any way to access a remote media sink?

    Like I mentioned before, the lag between the players needs to be as close to 0 as possible. I can achieve this when running on a single machine. I should also mention that I don't need audio support, only video. The player will be running in Windows 7, and I'm using the SP1 SDK.

    Is there another avenue I should be looking at?

    Thursday, May 5, 2011 5:30 PM


  • Maintaining synchronization across multiple networked machines is a difficult problem.  Both of the solutions you suggested -- using a remoted time source, and having one master machine that streams content to different machines -- are viable.  MF has no inbuilt mechanism for remoting clocks or media sinks, so you would need to write the code to send either the clock data or the media data over the network.  Either way, you would need to take into account the latency of communicating over the network in some way in order to ensure the networked machines do not get desynchronized.
    Thursday, June 16, 2011 9:47 PM