<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=FR-CA link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-CA>Hi!<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>I am working on a RTSP recorder and proxy module using the live library. Basically, it is a module which streams from an Axis camera to a matroska file and supply a RTSP server for viewers. It is very similar to the software “live555ProxyServer” but with a matroska muxer. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>The camera generates two RTP streams, one H264 and one AAC.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>As far as I know, the live pipeline is the same as the one in “live555ProxyServer” with an added StreamReplicator just after the rtpSources. For each stream, the replicator streams in the RTSP server and in the matroska muxer. I had to create a few components for the matroska muxer and to “fit” the stream replicator in the RTSP server.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>At first, instead of a RSTP server, I created RTP sinks and connected VLC using a SDP. It worked well but letting VLC select its listening ports and adding RTCP appeared to me to be a good idea. I replaced RTP sinks by a RTSP server which worked well until I added the audio stream. In fact, the server properly stream data to VLC and VLC plays fine until the RTCP synchronisation occurs. It then spits these messages to the console:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>[00000000026b4bf8] main video output warning: picture is too late to be displayed (missing 131234696 ms)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>[00000000026b4bf8] main video output warning: picture is too late to be displayed (missing 131234664 ms)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>[00000000026b4bf8] main video output warning: picture is too late to be displayed (missing 131234632 ms)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>[00000000026b4bf8] main video output warning: picture is too late to be displayed (missing 131234600 ms)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>[00000000026b4bf8] main video output warning: picture is too late to be displayed (missing 131234568 ms)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>As you certainly already know, VLC uses live for rtp/rtsp streaming, so I tried to watch these streams using a program based on “testRTSPclient”. The program displays the packets timestamps and adds an exclamation mark when not synchronized:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>Audio 2633490369 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633490390 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633490423 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Audio 2633490433 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633490457 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633490490 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Audio 2751915938<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633490523 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633490556 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Audio 2751916002<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633490590 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633490623 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Audio 2751916066<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633490656 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633490689 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Audio 2751916130<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633490723 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Audio 2751916194<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633490756 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633490789 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Audio 2751916258<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633490823 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633490856 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633490889 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Audio 2751916322<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Audio 2751916386<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633490922 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633490956 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633490989 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Audio 2751916450<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2633491022 !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2620681379<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Audio 2751916514<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2620681413<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2620681446<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Audio 2751916578<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2620681479<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2620681513<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Audio 2751916642<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2620681546<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2620681579<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Audio 2751916706<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2620681612<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2620681646<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Audio 2751916770<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2620681679<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Audio 2751916834<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2620681712<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2620681746<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Video 2620681779<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Audio 2751916890<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>As you can see, the timestamps (in milli sec) are in the same range before synchronization, but after synchronization, the gap VLC is complaining about appears.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>The gap is around 2751916890 – 2620681779 = 131235111.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>I’m still searching why RTCP create this gap. The issue is not the timestamp gap in one stream, but the difference between the synchronized timestamps of the two streams.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>The issue can be reproduced with an unmodified “live555ProxyServer”.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>The SDP, exchanged through RTSP is <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>v=0<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>o=- 1347046461812023 1 IN IP4 172.20.22.20<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>s=Session streamed by "VideoRecorder"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>i=av_stream<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>t=0 0<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>a=tool:LIVE555 Streaming Media v2012.07.06<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>a=type:broadcast<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>a=control:*<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>a=range:npt=0-<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>a=x-qt-text-nam:Session streamed by "VideoRecorder"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>a=x-qt-text-inf:av_stream<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>m=video 0 RTP/AVP 96<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>c=IN IP4 0.0.0.0<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>b=AS:50000<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>a=rtpmap:96 H264/90000<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>a=fmtp:96 packetization-mode=1;profile-level-id=420029;sprop-parameter-sets=Z0IAKeKQGQJvy4C3AQEBpB4kRUA=,aM48gA==<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>a=control:track1<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>m=audio 0 RTP/AVP 97<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>c=IN IP4 0.0.0.0<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>b=AS:32<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>a=rtpmap:97 MPEG4-GENERIC/16000<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>a=fmtp:97 streamtype=5;profile-level-id=15;mode=aac-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1408<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>a=control:track2<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>Any help will be appreciated.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>Thanks,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>Bruno Marchand<o:p></o:p></span></p></div></body></html>