<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)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Cambria;
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@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;}
@font-face
        {font-family:"Karbon Bold";
        panose-1:0 0 8 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Karbon Medium";
        panose-1:0 0 6 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Karbon Regular";
        panose-1:0 0 5 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:right;
        direction:rtl;
        unicode-bidi:embed;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
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;
        text-align:right;
        direction:rtl;
        unicode-bidi:embed;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
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";}
@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="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed">Hello there,<o:p></o:p></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed">I’ve been working on your library for a while now, in order to implement a RTSP server, streaming live audio and video.<o:p></o:p></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed">The audio and video packets are received via TCP from another service, each type of packet (audio\video) to another socket.<o:p></o:p></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed">What I did was creating a new sub-classes of MediaSubsession, one for PCM audio and one for H264 video, and for each one created a new framed source, similar to ByteStreamFileSource,
 where in their doReadFromFile() I call recv() to the relevant socket instead of fread().<o:p></o:p></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed">In my main, I just open the TCP sockets, create an RTSP server and add the two subsessions to it.<o:p></o:p></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><o:p> </o:p></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed">It works fine when I play video alone, or audio alone, but when I combine them the video usually stuck after a short while (~30 seconds) and the audio keeps playing ok.<o:p></o:p></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed">In addition, during the time both of them played ok, they are not synched.<o:p></o:p></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><o:p> </o:p></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed">What am I doing wrong? I’ve read a lot about it and it seems my presentation times are not ok, but how can I calculate them properly?<o:p></o:p></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed">Please advise, I’ve been working on this forever, and I’m sure it’ll be useful for others as well.<o:p></o:p></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><o:p> </o:p></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed">Thanks.<o:p></o:p></p>
<p class="MsoNormal" dir="RTL"><span dir="LTR"><o:p> </o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="641" style="width:480.7pt;border-collapse:collapse">
<tbody>
<tr style="height:70.4pt">
<td width="149" valign="top" style="width:111.75pt;padding:0cm 5.4pt 0cm 5.4pt;height:70.4pt">
<p class="MsoNormal" dir="RTL" style="margin-bottom:10.0pt;line-height:16.0pt"><span dir="LTR"><img width="133" height="34" id="_x0000_i1032" src="cid:image001.png@01D11700.3D6DA610"></span><span dir="LTR" style="font-size:2.0pt;mso-fareast-language:JA"><o:p></o:p></span></p>
<p class="MsoNormal" dir="RTL" style="margin-bottom:10.0pt;line-height:16.0pt"><a href="https://www.facebook.com/essencegrp?ref=hl" target="_blank"><span dir="LTR" style="font-family:"Cambria","serif";color:windowtext;text-decoration:none"><img border="0" width="17" height="17" id="Picture_x0020_2" src="cid:image002.png@01D11700.3D6DA610" alt="cid:89F8E3BA-1F79-4C4C-8A6E-85F03F7A4235"></span></a><span dir="LTR" style="font-family:"Cambria","serif";color:black"> </span><span dir="LTR"><a href="https://twitter.com/Essence_grp" target="_blank"><span style="font-family:"Cambria","serif";color:windowtext;text-decoration:none"><img border="0" width="13" height="17" id="Picture_x0020_3" src="cid:image003.png@01D11700.3D6DA610" alt="cid:7F760DA7-8206-4E09-A8F6-4CDFCDE78235"></span></a></span><span dir="LTR" style="font-family:"Cambria","serif";color:black"> </span><span dir="LTR"><a href="https://www.youtube.com/channel/UCOdUAVC7QmDoSZGyHMOjwUg" target="_blank"><span style="font-family:"Cambria","serif";color:windowtext;text-decoration:none"><img border="0" width="20" height="17" id="Picture_x0020_4" src="cid:image004.png@01D11700.3D6DA610" alt="cid:8622F469-70CD-439D-A066-E8D9B17BC323"></span></a></span><span dir="LTR" style="font-family:"Cambria","serif";color:black"> </span><span dir="LTR"><a href="http://www.linkedin.com/company/865102?trk=tyah&trkInfo=tas:essence%20g,idx:1-1-1" target="_blank"><span style="font-family:"Cambria","serif";color:windowtext;text-decoration:none"><img border="0" width="17" height="17" id="Picture_x0020_5" src="cid:image005.png@01D11700.3D6DA610" alt="cid:D211F5B7-C986-4790-B65C-1F8CB6060BF6"></span></a></span><span dir="LTR" style="font-family:"Cambria","serif";color:black"> </span><span dir="LTR"><a href="https://plus.google.com/u/0/107922789033407857840/posts" target="_blank"><span style="font-family:"Cambria","serif";color:windowtext;text-decoration:none"><img border="0" width="17" height="17" id="Picture_x0020_6" src="cid:image006.png@01D11700.3D6DA610" alt="cid:E725C345-8B3D-479D-8316-D67F8293CEE1"></span></a></span><span dir="LTR" style="mso-fareast-language:JA"><o:p></o:p></span></p>
</td>
<td width="492" valign="top" style="width:368.95pt;padding:0cm 5.4pt 0cm 5.4pt;height:70.4pt">
<p class="MsoNormal" style="margin-bottom:6.0pt;text-align:left;line-height:115%;direction:ltr;unicode-bidi:embed">
<b><span style="font-family:"Karbon Bold";color:#586DB2;mso-fareast-language:JA">Daniel Yacouboff
</span></b><b><span style="font-size:19.0pt;line-height:115%;color:#231F5C;mso-fareast-language:JA"><br>
</span></b><b><span style="font-family:"Karbon Medium";color:gray;mso-fareast-language:JA">QA and SW Engineer<br>
</span></b><span style="font-size:4.0pt;line-height:115%;color:#6D6D6D;mso-fareast-language:JA"><br>
</span><span style="font-size:10.0pt;line-height:115%;font-family:"Karbon Regular";color:gray;mso-fareast-language:JA">T: +972(73)2447-945
</span><a href="mailto:+972%2073%202447-757"><span style="font-size:10.0pt;line-height:115%;font-family:"Karbon Regular";color:gray;mso-fareast-language:JA;text-decoration:none">M: +972(54)6805-505</span></a><span style="font-size:8.0pt;line-height:115%;font-family:"Cambria","serif";color:gray;mso-fareast-language:JA">
<br>
</span><span style="font-size:10.0pt;line-height:115%;font-family:"Karbon Regular";color:gray;mso-fareast-language:JA">E: danielya@essence-grp.com  | </span><a href="http://www.essence-grp.com/"><span style="font-size:10.0pt;line-height:115%;font-family:"Karbon Regular";color:gray;mso-fareast-language:JA;text-decoration:none">www.essence-grp.com</span></a><b><span style="font-family:"Karbon Medium";color:gray;mso-fareast-language:JA"><o:p></o:p></span></b></p>
</td>
</tr>
<tr style="height:112.25pt">
<td width="641" colspan="2" valign="top" style="width:480.7pt;padding:0cm 5.4pt 0cm 5.4pt;height:112.25pt">
<p class="MsoNormal" dir="RTL" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:115%">
<b><span dir="LTR" style="color:#5C54A0">Come and meet us at our next events</span></b><span dir="LTR" style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" dir="RTL" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:115%">
<a href="http://events.essence-grp.com/"><span dir="LTR" style="color:windowtext;text-decoration:none"><img border="0" width="492" height="61" id="Picture_x0020_7" src="cid:image007.png@01D11700.3D6DA610" alt="cid:C4E7A1B1-AD2C-4A03-A68D-37EC473A58FF"></span></a><span dir="LTR" style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" dir="RTL" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:115%">
<a href="mailto:info@essence-grp.com"><span dir="LTR" style="color:windowtext;text-decoration:none"><img border="0" width="188" height="36" id="Picture_x0020_8" src="cid:image008.png@01D11700.3D6DA610" alt="cid:C59C7C8C-355B-4458-9F7A-9A490896466E"></span></a><span dir="LTR" style="color:black"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" dir="RTL" style="margin-bottom:10.0pt;line-height:115%"><span lang="ES-TRAD" dir="LTR" style="font-family:"Cambria","serif";color:black">             </span><span dir="LTR" style="font-size:10.5pt;line-height:115%;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" dir="RTL"><span dir="LTR"><o:p> </o:p></span></p>
</div>
</body>
</html>