Subject: [MMUSIC] We have seen Lip sync on RealOne player when playing audio and video MPEG1 ES on seperate ports

From: Deepak Kotian <[email-masked]>
Date: Wed, 17 Sep 2003 23:54:47 +0530

Hi,

    We could succesfully play audio and video over RealOne, Thanks for the
help provided.
     But when stream it together at different ports , it is having lip sync
issue.
    Is there a way we can reduce it .
    We are extracting the PTS and sending it the RTP timestamp.

    We are using RTSP and RTP for transport packets based on RFC 2250 and
RFC 1889.

    What is the factor which creates the lip sync on the RealOne player
    Any inputs on this would be very helpful.

Thanks and Regards
Deepak

---

From: Magnus Westerlund <[email-masked]>
Date: Thu, 18 Sep 2003 11:16:40 +0200

Hi,

I think you need to dig into this problem a bit more. The problem is 
that there are two potential error sources. I don't know how well Real 
One handles the synch information.

However the server must correctly give the synchronization information 
between the streams. That is include the both Range header and RTP-Info 
where the RTP-Info TS must be for the same point in time as the Range 
header gives. So for a two media session in aggregated session the PLAY 
response should look like this.

Range: npt=10-30
RTP-Info:url=rtsp://example.com/fizzle/audiotrack; 
seq=5712;rtptime=934207921,
  url=rtsp://example.com/fizzle/videotrack; seq=57654;rtptime=2792482193

Which means that for a time point 10 second into each media stream the 
TS has the given "rtptime" values. This gives the synch information.

If that information is given correctly then it should probably work. 
However you should also ensure that the RTCP synch information is 
consistent with this. Which means that the two media streams must be 
synchronized also in RTCP. The simplest way of doing this is to at the 
session start take a wall clock time and then assign the RTP TS for that 
point. Insert this into the calculation of the RTCP NPT and RTP TS times 
of sending for both RTP sessions.

Then when you issue a PLAY response for a given point in the play one 
takes a wall clock time reading. From that reading calculate the RTP TS 
for each individual media and the synchronized media time point. That 
way one ensures that the RTCP time is consistent through out the whole 
session.

Example:

Wall clock: 0---------10--------20--------30--------40 (s)
A TS 8000 : 567-------80567-----160567----240567----320567
B TS 90000: 8456------908456----1808456---2708456---3608456
Played rng:    10-------20      0--------------------------

If one at exactly 3 seconds since session start likes to start playing 
at media time 10, i.e. Range:npt=10-20, then stream A's rtptime becomes 
Initial_offset(567)+TS_rate(8000)*wall_clock(3.0000) = 24567. For Stream 
B the same thing is calculated (8456+90000*3.0000) = 278456

Resulting in a PLAY response of

Range: npt=10-20
RTP-Info:url=rtsp://example.com/stream_A; seq=5712;rtptime=24567,
  url=rtsp://example.com/stream_B; seq=57654;rtptime=278456

If one after playing the requested 10 seconds like to start from the 
beginning and Receive the PLAY request (Range:npt=0-) at 20 second into 
the session one simple measures the wall clock and calculate the new TS 
values, which if the PLAY time is exactly at 20 seconds it becomes the 
values given in the figure. Resulting in this PLAY response:

Range: npt=0-
RTP-Info:url=rtsp://example.com/stream_A; seq=5712;rtptime=160567,
  url=rtsp://example.com/stream_B; seq=57654;rtptime=1808456

The same base values are then used in RTCP to calculate the RTP TS when 
sending the RTCP packet and the corresponding NTP (Network Time 
Protocol) formated time.

End of example

Is this example clear? If that is the case I would suggest that I add 
this to Appendix B to clarify the synchronization in regards to RTP.
Proposals for improvement are encouraged.

Best Regards

-- 

Magnus Westerlund

Multimedia Technologies, Ericsson Research EAB/TVA/A
----------------------------------------------------------------------
Ericsson AB                | Phone +46 8 4048287
Torshamsgatan 23           | Fax   +46 8 7575550
S-164 80 Stockholm, Sweden | mailto: [email-masked]

_______________________________________________
mmusic mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/mmusic

---

From: Deepak Kotian <[email-masked]>
Date: Fri, 19 Sep 2003 01:12:04 +0530

Hi,

Thanks for the information. The example should be helpful for many.
Our case is RealTime, when we get continous data  from the encoder
board. We are streaming MPEG1 Video/Elementary ES at seperate ports.

Is it possible to elaborate on these lines.

Thanks and Regards
Deepak

----- Original Message -----
From: "Magnus Westerlund" <[email-masked]>
To: "Deepak Kotian" <[email-masked]>
Cc: "IETF MMUSIC WG" <[email-masked]>
Sent: Thursday, September 18, 2003 2:46 PM
Subject: Re: [MMUSIC] We have seen Lip sync on RealOne player when playing
audio and video MPEG1 ES on seperate ports