[MPlayer-dev-eng] Synchronization of players in LAN

Tono Esteve tono at sleiva.net
Wed Nov 26 11:36:13 CET 2003


Hi, I'm very interested in your modifications. Can you send me the 
modified files?.
I'm working in a similar project, I tested the mplayerd, but is too slow 
in response, and the sinchronization between several machines is poor.

I'm trying to modify the mplayer code, but I don't have successfully 
results (not yet...).

Thank's.

Tono Esteve.



PD: Sorry for my bad english...

J.A. Gutierrez escribió:

>On Thu, Nov 20, 2003 at 01:20:47PM +0100, Attila Kinali wrote:
>  
>
>>On Thu, 20 Nov 2003 10:14:24 +0100
>>"J.A. Gutierrez" <spd at shiva.cps.unizar.es> wrote:
>>
>>    
>>
>>>	I'm trying to synchronise several players running on several
>>>	computers connected to a dedicated 10/100 Ethernet switch. Each
>>>	one reads a different movie (video only) from its internal hard
>>>	disk, and resolution will be 768x576.
>>>      
>>>
>
>  
>
>>Mplayer does not sync against an external clock but syncs video to audio.
>>RTC is only used for sleeping, nothing more. See mplayer.c:2205
>>    
>>
>
>	OK, I've reading the source, and it seems it does synchronize
>	to system clock (providing the movie has no audio; which is
>	perfect for my setup).
>
>	In mplayer.c, it starts getting current time:
>
>	total_time_usage_start=GetTimer();
>
>	which in osdep/timer-lx.c calls gettimeofday(), which returns
>	current time, which is fixed by NTP.
>
>	Right after the "PLAY VIDEO" comment, it starts decoding
>	video. It reads and decodes the frame; and then "It's time
>	to sleep..." where calculates remaining time with
>	time_frame-=GetRelativeTime();
>	and if there is no sound, it will sleep for frame_time.
>
>
>	
>
>	So, this is what I've done so far:
>
>
>	- Setup NTP for system clock synchronisation.
>
>	- Add some network code to make an udp server.
>	(two files, network.c/network.h)
>
>	- Add some lines to mplayer.c so it:
>
>		* On start will wait for an UDP broadcast packet.
>		* Once the packet has arrived, will wait for the next second
>		boundary (i.e. 0 == GetTimerMS() % 1000)
>
>
>	- A minimal program which sends the broadcast packet.
>
>	If there is someone interested I could make the files available.
>	By now it seems good enough for me, but my in code in mplayer.c
>	is really quick and dirty:
>	
>		* doesn't use options, it always wait for udp, and then
>		for %1000 ms. Should use command line options.
>
>		* uses RTC only.
>
>		* about ten lines of new code.
>
>  
>



More information about the MPlayer-dev-eng mailing list