[Live-devel] How to make client get original PTS of the sender?

Ross Finlayson finlayson at live555.com
Mon Nov 4 06:14:38 PST 2019



> On Nov 4, 2019, at 5:08 AM, Ha Viet <steveha at u2sr.com> wrote:
> 
> I am using your live555 library to transmitting h264 streams from my server to clients.
> The server bases on OnDemandServerMediaSubsession and the client bases on testRTSPClient.
> Both of them work pretty well except one thing is: I do not know the way to make PTS of original 
> stream preserved through the transmission. 

Because of the way our server is implemented, you can’t do this.  Instead, the “fPresentationTime” values - used by our server when outputting data - must be aligned with ‘wall clock’ time (i.e., the time that you would get by calling “gettimeofday()”).

This does not mean that your server cannot use pre-recorded presentation time stamps.  You can do this; however, the *first* “fPresentationTime” must be aligned with the time that you’d get by calling “gettimeofday()”.  Thereafter, you can just add a constant offset to your prerecorded presentation time stamps.  I.e., in pseudo-code:

- For the first “fPresentationTime”:
	fPresentationTime = gettimeofday()
	const ptsOffset = fPresentationTime - prerecordedPresentationTime[0]
- For subsequent “fPresentationTimes”:
	fPresentationTime = prerecordedPresentationTime[N] + ptsOffset


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/




More information about the live-devel mailing list