<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">After creating my own class's<o:p class=""></o:p></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -18pt;" class=""><span style="font-size: 9.5pt; font-family: Symbol;" class=""><span class="">·<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman';" class=""> <span class="Apple-converted-space"> </span></span></span></span><span style="font-size: 9.5pt; font-family: Consolas;" class="">class myRTSPSinkOndemandMediaSubsession : public OnDemandServerMediaSubsession<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -18pt;" class=""><span style="font-size: 9.5pt; font-family: Symbol;" class=""><span class="">·<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman';" class=""> <span class="Apple-converted-space"> </span></span></span></span><span style="font-size: 9.5pt; font-family: Consolas;" class="">class myFrameSource : public FramedSource</span></div></div></div></blockquote><div><br class=""></div>If your “myFrameSource” class delivers discrete H.264 NAL units (i.e., one at a time), rather than an unstructured byte stream, then you MUST feed this into a “H264VideoStreamDiscreteFramer”, NOT a “H264VideoStreamFramer”.</div><div><br class=""></div><div>In particular, your “myRTSPSinkOndemandMediaSubsession” class’s implementation of the "createNewStreamSource()” virtual function should look something like this: </div><div><br class=""></div><div>//////////</div><div>FramedSource* myRTSPSinkOndemandMediaSubsession::createNewStreamSource(unsigned /*clientSessionId*/, unsigned& estBitrate) {<br class=""> estBitrate = 500; // in kbps; set this to an appropriate estimate of your stream’s bitrate<br class=""><br class=""> // Create the video source:<br class=""> FramedSource* videoSource = myFrameSource::createNew(envir(), params);</div><div><br class=""></div><div> // Create a framer for the video stream:<br class=""> return H264VideoStreamDiscreteFramer::createNew(envir(), videoSource);<br class="">}<br class=""><div>//////////</div><br class="">Note also that - because you’re feeding into a “H264VideoStreamDiscreteFramer” - each H.264 NAL unit delivered by your “myFrameSource” object MUST NOT begin with a ‘start code’ (0x00 0x00 0x00 0x01).</div><div><br class=""></div><div>Also, if your encoder doesn’t automatically do so, then you should arrange for the first two NAL units delivered by your “myFrameSource” object to be a SPS and a PPS NAL unit. (Alternatively, in your implementation of the “createNewRTPSink()” virtual function, you can use one of the forms of “H264VideoRTPSink::createNew()” that takes SPS and PPS NAL unit information as parameters.)<br class=""></div><br class=""><br class=""><div apple-content-edited="true" class="">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Ross Finlayson<br class="">Live Networks, Inc.<br class=""><a href="http://www.live555.com/" class="">http://www.live555.com/</a></span></span>
</div>
<br class=""></body></html>