[Live-devel] How framerate is passing to rtsp client

Paweł Domagalski pawel.domagalski at mobica.com
Fri Apr 1 04:51:33 PDT 2016


I have compared logs from my rtsp server ( runned on embedded device) 
and rtsp client ( runned on PC) and I found difference in timestamps.
On the server has elapsed 4.7 s
On the testRTSPClient has elapsed 1.6 s.

First timestamps are similar but next one is +110 ms on the server and + 
40 ms on the client.

I have dumped RTP transmission using wireshark and I have checked that 
timestamp field is incremented by 3600 with every frame;
I have read document RFC6184 chapter 5. RTP payload format. There is 
description of timestamp:
"Timestamp: 32 bits The RTP timestamp is set to the sampling timestamp 
of the content. A 90 kHz clock rate MUST be used."

I am working on embedded device and I assume that my system timer is not 
90kHz clocked. Am I right ? I must investigate how timestamp is 
calculated. Any advice ? RTPSink class will be good place to investigate ?

What else, I see that first packet is not displayed by testRTSPClient 
but it is another issue which probably has not influence on my problem.

Below I pasted logs from my server and from testRTSPClient application.

Regards

Server:
PIPE:LOS: Sending 13164 bytes   Presentation time: 567993726.600011
PIPE:LOS: Sending 10742 bytes   Presentation time: 567993726.719010
PIPE:LOS: Sending 11823 bytes   Presentation time: 567993726.827011
PIPE:LOS: Sending 11831 bytes   Presentation time: 567993726.946010
PIPE:LOS: Sending 11840 bytes   Presentation time: 567993727.053011
PIPE:LOS: Sending 12131 bytes   Presentation time: 567993727.173045
PIPE:LOS: Sending 11929 bytes   Presentation time: 567993727.281011
PIPE:LOS: Sending 11992 bytes   Presentation time: 567993727.399010
PIPE:LOS: Sending 11987 bytes   Presentation time: 567993727.508013
PIPE:LOS: Sending 15912 bytes   Presentation time: 567993727.625010
PIPE:LOS: Sending 11970 bytes   Presentation time: 567993727.744019
PIPE:LOS: Sending 11889 bytes   Presentation time: 567993727.854011
PIPE:LOS: Sending 11817 bytes   Presentation time: 567993727.965011
PIPE:LOS: Sending 4137 bytes with truncated 7685 bytes  Presentation 
time: 567993728.084010
PIPE:LOS: Sending 7685 bytes    Presentation time: 567993728.094322
PIPE:LOS: Sending 11821 bytes   Presentation time: 567993728.193010
PIPE:LOS: Sending 11857 bytes   Presentation time: 567993728.311010
PIPE:LOS: Sending 11833 bytes   Presentation time: 567993728.421011
PIPE:LOS: Sending 11788 bytes   Presentation time: 567993728.541010
PIPE:LOS: Sending 15631 bytes   Presentation time: 567993728.650010
PIPE:LOS: Sending 11713 bytes   Presentation time: 567993728.768010
PIPE:LOS: Sending 11683 bytes   Presentation time: 567993728.877011
PIPE:LOS: Sending 11784 bytes   Presentation time: 567993728.996011
PIPE:LOS: Sending 11707 bytes   Presentation time: 567993729.104011
PIPE:LOS: Sending 11759 bytes   Presentation time: 567993729.224049
PIPE:LOS: Sending 11814 bytes   Presentation time: 567993729.334011
PIPE:LOS: Sending 8925 bytes with truncated 2975 bytes  Presentation 
time: 567993729.447011
PIPE:LOS: Sending 2975 bytes    Presentation time: 567993729.459502
PIPE:LOS: Sending 11726 bytes   Presentation time: 567993729.560011
PIPE:LOS: Sending 15451 bytes   Presentation time: 567993729.679049
PIPE:LOS: Sending 11609 bytes   Presentation time: 567993729.788010
PIPE:LOS: Sending 11605 bytes   Presentation time: 567993729.907035
PIPE:LOS: Sending 11724 bytes   Presentation time: 567993730.016011
PIPE:LOS: Sending 11697 bytes   Presentation time: 567993730.134052
PIPE:LOS: Sending 11729 bytes   Presentation time: 567993730.243012
PIPE:LOS: Sending 11911 bytes   Presentation time: 567993730.361011
PIPE:LOS: Sending 12043 bytes   Presentation time: 567993730.471021
PIPE:LOS: Sending 12031 bytes   Presentation time: 567993730.590034
PIPE:LOS: Sending 15888 bytes   Presentation time: 567993730.698011
PIPE:LOS: Sending 9609 bytes with truncated 2372 bytes  Presentation 
time: 567993730.818010
PIPE:LOS: Sending 2372 bytes    Presentation time: 567993730.833537
PIPE:LOS: Sending 11981 bytes   Presentation time: 567993730.928011
PIPE:LOS: Sending 12015 bytes   Presentation time: 567993731.046010
PIPE:LOS: Sending 12124 bytes   Presentation time: 567993731.157018
PIPE:LOS: Sending 12024 bytes   Presentation time: 567993731.275042
PIPE:LOS: Sending 12051 bytes   Presentation time: 567993731.383011


testRTSPClient:

Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
10738 bytes.   Presentation time: 567993726.682812
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11819 bytes.   Presentation time: 567993726.722812
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11827 bytes.   Presentation time: 567993726.762812
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11836 bytes.   Presentation time: 567993726.802800
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
12127 bytes.   Presentation time: 567993726.842800
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11925 bytes.   Presentation time: 567993726.882800
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11988 bytes.   Presentation time: 567993726.922800
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11983 bytes.   Presentation time: 567993726.962800
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
15908 bytes.   Presentation time: 567993727.002800
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11966 bytes.   Presentation time: 567993727.042800
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11885 bytes.   Presentation time: 567993727.082800
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11813 bytes.   Presentation time: 567993727.122800
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11818 bytes.   Presentation time: 567993727.162800
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11817 bytes.   Presentation time: 567993727.202800
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11853 bytes.   Presentation time: 567993727.242800
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11829 bytes.   Presentation time: 567993727.282788
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11784 bytes.   Presentation time: 567993727.322788
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
15627 bytes.   Presentation time: 567993727.362788
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11709 bytes.   Presentation time: 567993727.402788
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11679 bytes.   Presentation time: 567993727.442788
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11780 bytes.   Presentation time: 567993727.482788
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11703 bytes.   Presentation time: 567993727.522788
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11755 bytes.   Presentation time: 567993727.562788
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11810 bytes.   Presentation time: 567993727.602788
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11896 bytes.   Presentation time: 567993727.642788
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11722 bytes.   Presentation time: 567993727.682788
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
15447 bytes.   Presentation time: 567993727.722776
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11605 bytes.   Presentation time: 567993727.762776
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11601 bytes.   Presentation time: 567993727.802776
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11720 bytes.   Presentation time: 567993727.842776
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11693 bytes.   Presentation time: 567993727.882776
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11725 bytes.   Presentation time: 567993727.922776
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11907 bytes.   Presentation time: 567993727.962776
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
12039 bytes.   Presentation time: 567993728.002776
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
12027 bytes.   Presentation time: 567993728.042776
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
15884 bytes.   Presentation time: 567993728.082776
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11977 bytes.   Presentation time: 567993728.122776
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
11977 bytes.   Presentation time: 567993728.162764
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
12011 bytes.   Presentation time: 567993728.202764
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
12120 bytes.   Presentation time: 567993728.242764
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
12020 bytes.   Presentation time: 567993728.282764
Stream "rtsp://192.168.1.82:8554/testStream/"; video/H264: Received 
12047 bytes.   Presentation time: 567993728.322764



On 31/03/16 22:33, Ross Finlayson wrote:
> The (64-bit) "presentation time” values are not passed directly from the server to the client; instead, they are transferred implicitly, using the (32-bit) RTP timestamps in each RTP packet, plus periodic RTCP packets that provide the mapping from RTP timestamp to “presentation time”.  This is all very complicated, and is (IMHO) a flaw in the RTP/RTCP design; it was done to save space in each RTP packet.  However, our code (at both the server end and the client end) handles this all automatically, so that you don’t need to worry about it.
>
> HOWEVER, for this to work properly (when writing a server that uses the LIVE555 code), the "presentation time” values that the server generates MUST be aligned with ‘wall clock’ time - i.e., the times that you’d get by calling “gettimeofday()”.
>
> Therefore, you should go back to using “gettimeofday()” to generate your presentation times (in your server code).  (However, if you have more than one NAL unit for the same video frame, then each of these NAL units should be given the same presentation time.)
>
>
> Ross Finlayson
> Live Networks, Inc.
> http://www.live555.com/
>
>
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel

-- 
Paweł Domagalski
Software Engineer
Mobica Ltd.
www.mobica.com

Mobica is a provider of innovative, cutting-edge software engineering, testing and consultancy services. Based in the UK, Poland, the USA and Mexico, Mobica has a worldwide customer base and a proven track record in delivering complex solutions to global leaders in a range of sectors including automotive, mobile, semiconductor, finance, TV & broadcasting, telecommunications, connected devices, marine and aviation.

Mobica Limited is a limited company registered in England and Wales with registered number 05169596 and VAT registered number 845117630. Our registered office is at Crown House, Manchester Road, Wilmslow, Cheshire, SK9 1BH, UK.
  
This message is intended solely for the addressee(s) and may contain confidential information. If you have received this message in error, please send it back to us, and immediately and permanently delete it. Do not use, copy or disclose the information contained in this message or in any attachment.



More information about the live-devel mailing list