<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style>
<!--
@font-face
        {font-family:Calibri}
@font-face
        {font-family:Tahoma}
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
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif"}
span.BalloonTextChar
        {font-family:"Tahoma","sans-serif"}
span.EmailStyle20
        {font-family:"Calibri","sans-serif";
        color:#1F497D}
span.EmailStyle21
        {font-family:"Calibri","sans-serif";
        color:#1F497D}
.MsoChpDefault
        {font-size:10.0pt}
@page WordSection1
        {margin:1.0in 1.0in 1.0in 1.0in}
-->
</style><style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" vlink="purple" lang="EN-US" link="blue">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 13px;">
<div style="">I have solved this in my code by cacheing and inserting into the stream (using a filter).<br>
<br>
The decoder always needs it and, as stated, some encoders do not(axis default,pelco), some do(gvi,samsung) and some it is a setting(axis)<br>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF722449"><font color="#000000" face="Tahoma" size="2"><b>From:</b> live-devel-bounces@ns.live555.com [live-devel-bounces@ns.live555.com] on behalf of Markus Schumann [markuss@sonicfoundry.com]<br>
<b>Sent:</b> Friday, April 26, 2013 3:02 PM<br>
<b>To:</b> LIVE555 Streaming Media - development & use<br>
<b>Subject:</b> Re: [Live-devel] testRTSPClient / H.264 Network Camera Stream<br>
</font><br>
</div>
<div></div>
<div>
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">I decode H.264 from a network camera.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">My decoder wants SPS/PPS once before the first I-frame in band delivered.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">So I wait until I get the first I-frame and then insert 0x0000001/SPS/0x0000001/PPS before the I-frame.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Interestingly - one of the cameras I test with sends SPS/PPS inside the RTP stream – I drop those SPS/PPSs.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">But you are right – it’s decoder dependent.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Markus.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </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>Jeremiah Morrill<br>
<b>Sent:</b> Friday, April 26, 2013 2:23 PM<br>
<b>To:</b> LIVE555 Streaming Media - development & use<br>
<b>Subject:</b> Re: [Live-devel] testRTSPClient / H.264 Network Camera Stream</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">After you parse the nal records from parseSPropParameterSets, store them.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">For each sample that comes through, construct the buffer you send to your upstream decoder like this:</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Where start_code is 4 bytes 0x00, 0x00, 0x00, 0x01</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">[start_code][NAL_record_1][start_code][NAL_record_2][start_code][sample_data]</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">There may be some more correct way, but this has worked for me.  Also some h264 decoders are different in how they except NAL units, so you may want to check
 with the documentation.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">-Jer</span></p>
</div>
</div>
</div>
</div>
<P> </P>
<P> </P>
<P>This message and any attachments contain confidential and proprietary 
information, and may contain privileged information, belonging to one or more 
affiliates of Windy City Wire Cable & Technology Products, LLC. No privilege 
is waived by this transmission. Unauthorized use, copying or disclosure of such 
information is prohibited and may be unlawful. If you receive this message in 
error, please delete it from your system, destroy any printouts or copies of it, 
and notify the sender immediately by e-mail or phone.</P><br></body>
</html>