<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: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:0in;
        margin-bottom:.0001pt;
        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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.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='color:#1F497D'>This is the exact stream format I get from my encoders<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Given nal type 7 = SPS,8 = PPS, 5 = IDR slices, and 1 = Diff frames <o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I see [7][8][5][1][1][1][1][1]  of 6fps streams less than Mp<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I see [7][8][5][5][5][1][1][1][1][1] on 6ms multimega-pixel streams.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Some streams to NOT have the  SPS and PPS in the stream so I datamine them from the SDP packet and remember them for insertion into the stream. This makes libavcodec happy. I always send the encoder a SPS+PPS + IDRSlice  as an aggregated frame (00 00 01 in front of each, it need that delimetter)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I have a filter that does this aggregation for me.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='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>David J Myers<br><b>Sent:</b> Wednesday, December 21, 2011 9:22 AM<br><b>To:</b> live-devel@ns.live555.com<br><b>Subject:</b> Re: [Live-devel] Live555 EventLoop Crash<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-GB>Hi Ross,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>>><i> On further examination of my encoded frame data, it looks like an I-frame consists of 3 NAL units, each preceded by 00 00 00 01, the first NALU is 17 bytes long, the second NALU is 9 bytes long, and the 3rd NALU is the rest of the frame size. Each P-frame is just one NALU.<o:p></o:p></i></span></p><p class=MsoNormal><span lang=EN-GB>>><i> My code is now using H264VideoStreamDiscreteFramer and sending each NAL unit one by one. So each I-Frame is sent with 3 calls to afterGetting(this).<o:p></o:p></i></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>>You can do this only if each call to "afterGetting(this)" corresponds to exactly one earlier call to "doGetNextFrame()".  I.e., you *must not* call "afterGetting(this)" more than once for each call to "doGetNextFrame()".<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>>I.e, if you want to deliver these three NAL units - one at a time - to the downstream object (in this case, a "H264VideoStreamDiscreteFramer"), then you must really do so 'one at a time'.  Each call to "doGetNextFrame()" must be followed by one (and only one) data delivery, followed by a call to "FramedSource::afterGetting()".<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>>If you do this properly, though, then this should produce a proper RTSP/RTP stream.  (However, I suggest that you test this first with "openRTSP", rather than VLC.)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>Ok, understood. How do I get these extra calls to doGetNextFrame()? Currently I’m getting one call to doGetNextFrame(), but I’m then sending all three NAL units for the frame which, as you say, doesn’t produce a decent stream. - David <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><div class=MsoNormal align=center style='text-align:center'><span lang=EN-GB style='font-size:12.0pt;font-family:"Times New Roman","serif"'><hr size=1 width="100%" noshade style='color:#A0A0A0' align=center></span></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-GB style='font-size:12.0pt;font-family:"Times New Roman","serif"'>No virus found in this message.<br>Checked by AVG - <a href="http://www.avg.com">www.avg.com</a><br>Version: 2012.0.1890 / Virus Database: 2109/4694 - Release Date: 12/21/11<o:p></o:p></span></p></div></body></html>