[MPlayer-users] MPEG2 audio video synchronisation

Nico Sabbi Nicola.Sabbi at poste.it
Wed Jul 25 12:09:56 CEST 2007


Vinod Madhav Joshi wrote:

>>If you have correct timestamps in the stream received by the server
>>mplayer will take care of the sync provided that the demuxer you use
>>(btw, what kind of stream is it? )
>>    
>>
>
>I am receiving Demuxed elenentary streams(audio and video of MPEG Program
>Stream).
>
>
>  
>
I've understood this, but what kind of stream type is it?
rt[s]p ? mms ? something else? something custom for your
application?

>>assigns those timestamps to the
>>demux_packetS
>>sent to demuxer->video and demuxer->audio.
>>    
>>
>
>
> I am receiving the audio and video elementary streams on
> different ports with their respective timestamps(Initial
> timestamp will be random and different for both Audio and Video)
>  
>

nice, it's all you need to have

> In this case how to synchronize audio and video?
>
> In the mplayer source code i am not able to differentiate
> the sync provided for streams stored on hard disc(PS or TS)
> and that received from network.
>  
>

because mplayer.c will take care of keeping sync; demuxers don't
do anything else than
dp = new demux_packet();
memcpy(dp->buf, demuxed_data, demuxed_data_len);
dp->pts = mypts_read_from_network_encapsulator;
ds_add_packet(demuxer->(video|audio|sub), dp);

and you should do the same thing in your code (I guess you
are developing a custom demuxer and a custom network stream reader, right? )

> In case of MPEG Program stream or Transport stram the PES will contain
> the PTS values for audio and video.
>
> But in case of elementary streams how the sync is provided by mplayer?
>
>
> Thank You.
>  
>
as in the pseudo code I posted



More information about the MPlayer-users mailing list