<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=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<base href="x-msg://805/"><!--[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:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        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:"Trebuchet MS";
        panose-1:2 11 6 3 2 2 2 2 2 4;}
@font-face
        {font-family:"Abadi MT Condensed Light";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","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:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.apple-tab-span
        {mso-style-name:apple-tab-span;}
span.apple-style-span
        {mso-style-name:apple-style-span;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
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-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi All,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks for the expedient response.  What I failed to mention in my original email was that we are developing a transcoding server that will encode mjpeg stream
 to H264 stream in real time and send out both streams through RTSP to multiple clients.  We were able to build the pipeline and grab the mjpeg stream from the camera through Live555 testRTSPClient program and encode the resulting stream and send it out to
 multiple clients.  <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">The issue we have now is that in retransmitting the audio stream we don’t understand if Live555 adds an extra header to the AAC frames.  This is because we
 are able to use the RTSPClient subsession to generate the initial settings for our server’s RTPSink and all works fine.  Also, we have different threads to spool up multiple streams from different cameras and as a result, our clients have different UsageEnvironments
 and TaskSchedulers from that of the RTSPServer (this was mentioned as a way to implement transferring streams from live sources).  In order to transfer the streams, we copy the Live555 buffers into our shared buffers and call the event trigger on the onDemandMediaServerSubsession
 creatNewStreamSource function.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">So in our project the pipeline looks like:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">testRTSPClient (jpeg & aac):TaskScheduler1 
</span><span style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">à</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> shared buffer (jpeg & aac)
</span><span style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">à</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> H.264 encoder (h.264)
</span><span style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">à</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> RTSPServer (jpeg & h.264 & aac):TaskScheduler2
</span><span style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">à</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> Client<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">We have the jpeg and h.264 pipeline going, we just need to know what headers the MPEG4GenericRTPSource is adding to the aac frames to be able to retransmit
 it so VLC can play it.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><b><span style="font-family:"Trebuchet MS","sans-serif";color:#1F497D">Togba Liberty<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Trebuchet MS","sans-serif";color:black">C++ Developer | ipConfigure, Inc.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Trebuchet MS","sans-serif";color:black">www.ipconfigure.com<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Abadi MT Condensed Light","serif";color:black"><img width="250" height="100" id="Picture_x0020_1" src="cid:image001.png@01CDFB02.582839B0" alt="Description: cid:7D82F492-5DFF-427B-9295-2AD8F6DD9DA3"></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> live-devel-bounces@ns.live555.com [mailto:live-devel-bounces@ns.live555.com]
<b>On Behalf Of </b>Ross Finlayson<br>
<b>Sent:</b> Thursday, January 24, 2013 7:49 PM<br>
<b>To:</b> LIVE555 Streaming Media - development & use<br>
<b>Subject:</b> Re: [Live-devel] About AAC Streaming<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Can you please provide some insight as to the frames generated by MPEG4GenericRTPSource so that we can have an idea of how to restream the AAC audio.<o:p></o:p></span></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<p class="MsoNormal">The frames are simply AAC audio frames, delivered one at a time.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">However, to decode (or restream) these frames, you also need extra 'configuration' information.  This is carried 'out of band' in the stream's SDP description (that the client received in response to its initial RTSP "DESCRIBE" command).
  You can get this information by calling the following functions on the stream's "MediaSubsession" object:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span class="apple-tab-span">            </span>MediaSubsession::fmtp_mode()<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span class="apple-tab-span">                        </span>
This will return a string like "AAC-hbr" - describing which particular AAC 'mode' this audio stream is<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span class="apple-tab-span">            </span>MediaSubsession::fmtp_config()<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span class="apple-tab-span">                        </span>
This returns a string that contains 'configuration' information.  Depending upon your decoder, you can pass this string to your decoder 'as is', or you can translate it into binary form by calling our function "parseGeneralConfigStr()".  However, for restreaming
 the frames, the configuration information stays in string form (see below).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">To restream these frames, you need to create a "MPEG4GenericRTPSink" object, as follows:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span class="apple-tab-span">            </span>RTPSink* audioRTPSink = MPEG4GenericRTPSink::createNew(envir(), rtpGroupsock, rtpPayloadType, mediaSubsession->rtpTimestampFrequency(),<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><span class="apple-tab-span">                                                                                               
</span>"audio", mediaSubsession->fmtp_mode(),<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span class="apple-tab-span">                                                                                               
</span>mediaSubsession->fmtp_config(), mediaSubsession->numChannels());<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal">and, as always, an associated "RTCPInstance" object (to implement RTCP).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">You can then do the restreaming by calling "startPlaying()" on this "MPEG4GenericRTPSink", taking its input from "mediaSubsession->readSource()" - i.e.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span class="apple-tab-span">            </span>audioRTPSink->startPlaying(*(mediaSubsession->readSource()), <etc>);<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span class="apple-style-span"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif";color:black">Ross Finlayson</span></span><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif";color:black"><br>
<span class="apple-style-span">Live Networks, Inc.</span><br>
<span class="apple-style-span"><a href="http://www.live555.com/">http://www.live555.com/</a></span></span>
<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>