<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hi,</p>
<p>My embedded video server outputs an H264 Multicast video stream at 25fps.</p>
<p>It is a requirement that multiple VLC client sessions join the stream via ONVIF which results in an RTSP handshake to get the multicast SDP details to join.</p>
<p>This works fine, however when each new client joins I get a jump in presentation time which results in a glitch in the video of all connected VLC clients.</p>
<p>My code for setting the presentation time is really simple:-</p>
<pre><em>if (fPresentationTime.tv_sec == 0 && fPresentationTime.tv_usec == 0)
</em> <em>gettimeofday(&fPresentationTime, NULL);
</em><em>else
</em><em>{
</em><em> // Increment by the sample time
</em> <em> unsigned uSeconds = fPresentationTime.tv_usec + 1000000/25; //25fps, </em><em>the frame rate (40ms)
</em> <em>fPresentationTime.tv_sec += uSeconds/1000000;
</em> <em>fPresentationTime.tv_usec = uSeconds%1000000;
</em><em>}<br /><br /></em>I don't set fPresentation time anywhere else, so I can't understand why I get this jump in presentation time which can be up to 500ms. <br />A wireshark trace looks like this:<br /><br />2779 6.395002 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38492, Time=2630245072 FU-A Start:non-IDR-Slice<br />2780 6.395002 10.26.7.77 232.26.7.77 H264 1197 PT=H264, SSRC=0x2DC80377, Seq=38493, Time=2630245072, Mark FU-A End<br />2781 6.456028 10.26.7.77 232.26.7.77 H264 66 PT=H264, SSRC=0x2DC80377, Seq=38494, Time=2630248672 SPS<br />2782 6.456028 10.26.7.77 232.26.7.77 H264 60 PT=H264, SSRC=0x2DC80377, Seq=38495, Time=2630248672 PPS<br />2783 6.457999 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38496, Time=2630248672 FU-A Start:IDR-Slice<br />2784 6.457999 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38497, Time=2630248672 FU-A<br />2785 6.457999 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38498, Time=2630248672 FU-A<br />2786 6.459001 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38499, Time=2630248672 FU-A<br />2787 6.459001 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38500, Time=2630248672 FU-A<br />2788 6.460000 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38501, Time=2630248672 FU-A<br />2789 6.460000 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38502, Time=2630248672 FU-A<br />2790 6.460000 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38503, Time=2630248672 FU-A<br />2791 6.460993 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38504, Time=2630248672 FU-A<br />2792 6.460993 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38505, Time=2630248672 FU-A<br />2793 6.462031 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38506, Time=2630248672 FU-A<br />2794 6.462031 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38507, Time=2630248672 FU-A<br />2795 6.462985 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38508, Time=2630248672 FU-A<br />2796 6.462985 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38509, Time=2630248672 FU-A<br />2797 6.463033 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38510, Time=2630248672 FU-A<br />2798 6.463985 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38511, Time=2630248672 FU-A<br />2799 6.463985 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38512, Time=2630248672 FU-A<br />2800 6.464981 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38513, Time=2630248672 FU-A<br />2801 6.464981 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38514, Time=2630248672 FU-A<br />2802 6.465982 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38515, Time=2630248672 FU-A<br />2803 6.465982 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38516, Time=2630248672 FU-A<br />2804 6.466982 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38517, Time=2630248672 FU-A<br />2805 6.466982 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38518, Time=2630248672 FU-A<br />2806 6.466982 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38519, Time=2630248672 FU-A<br />2807 6.468009 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38520, Time=2630248672 FU-A<br />2808 6.468009 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38521, Time=2630248672 FU-A<br />2809 6.468984 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38522, Time=2630248672 FU-A<br />2810 6.468984 10.26.7.77 232.26.7.77 H264 1097 PT=H264, SSRC=0x2DC80377, Seq=38523, Time=2630248672, Mark FU-A End<br />2811 6.476999 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38524, Time=2630252272 FU-A Start:non-IDR-Slice<br />2812 6.476999 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38525, Time=2630252272 FU-A<br />2813 6.476999 10.26.7.77 232.26.7.77 H264 108 PT=H264, SSRC=0x2DC80377, Seq=38526, Time=2630252272, Mark FU-A End<br />2819 6.514185 10.26.7.83 10.26.7.77 RTSP 177 OPTIONS rtsp://10.26.7.77:554/stream0 RTSP/1.0<br />2821 6.515988 10.26.7.77 10.26.7.83 RTSP 206 Reply: RTSP/1.0 200 OK<br />2822 6.516092 10.26.7.83 10.26.7.77 RTSP 203 DESCRIBE rtsp://10.26.7.77:554/stream0 RTSP/1.0<br />2823 6.518007 10.26.7.77 10.26.7.83 RTSP 229 Reply: RTSP/1.0 401 Unauthorized<br />2824 6.518098 10.26.7.83 10.26.7.77 RTSP 400 DESCRIBE rtsp://10.26.7.77:554/stream0 RTSP/1.0<br />2825 6.520986 10.26.7.77 10.26.7.83 RTSP/SDP 723 Reply: RTSP/1.0 200 OK<br />2826 6.521655 10.26.7.83 10.26.7.77 RTSP 424 SETUP rtsp://10.26.7.77/stream0/track1 RTSP/1.0<br />2827 6.524993 10.26.7.77 10.26.7.83 RTSP 242 Reply: RTSP/1.0 200 OK<br />2828 6.525466 10.26.7.83 232.26.7.77 RTP 46 Unknown RTP version 3<br />2830 6.525553 10.26.7.83 232.26.7.77 RTP 46 Unknown RTP version 3<br />2832 6.525616 10.26.7.83 10.26.7.77 RTSP 403 PLAY rtsp://10.26.7.77/stream0/ RTSP/1.0<br />2834 6.530026 10.26.7.77 10.26.7.83 RTSP 234 Reply: RTSP/1.0 200 OK<br />2835 6.530026 10.26.7.77 232.26.7.77 H264 66 PT=H264, SSRC=0x2DC80377, Seq=38527, Time=2630338005 SPS<br />2837 6.530026 10.26.7.77 232.26.7.77 H264 60 PT=H264, SSRC=0x2DC80377, Seq=38528, Time=2630338005 PPS<br />2838 6.531997 10.26.7.77 232.26.7.77 H264 1498 PT=H264, SSRC=0x2DC80377, Seq=38529, Time=2630338005 FU-A Start:IDR-Slice <br /><br />Everything is fine with the timestamp increasing by 3600 (40ms) each frame, until the next VLC client joins. The next video frame has a timestamp <br />which is around 95ms after the previous frame even though it has the next sequence number so no frames are missing.<br /><br /></pre>
<p>What could be causing this jump in fPresentationTime? Is there anything in the live555 library under the hood which modifies this variable? If fPresentationTime got set to zero, that would cause gettimeofday() to be called and this could explain it, but I can't see why this would happen.</p>
<p>Any help or advice would be very welcome.</p>
<p><br /></p>
<div id="v1_rc_sig"></div>
</body></html>