Hello Ross<div><br></div><div>Thank you very much for your fast and nice reply. </div><div><br></div><div>After <span class="Apple-style-span" style="font-family:Menlo;font-size:11px">parseSPropParameterSets, I should be able to get sps and pps(in binary format?)</span></div>
<div><span class="Apple-style-span" style="font-family:Menlo;font-size:11px"><br></span></div><div><span class="Apple-style-span" style="font-family:Menlo;font-size:11px">But when i use print command to print the strings, I got some wired data. I m not sure why it looks like that:</span></div>
<div><span class="Apple-style-span" style="font-family:Menlo;font-size:11px"><p style="margin:0px 0px 0px 0px;font:11.0px Menlo"><span style="color:#bb2d9d"><br></span></p><p style="margin:0px 0px 0px 0px;font:11.0px Menlo">
<span style="color:#bb2d9d">code:</span></p><p style="margin:0px 0px 0px 0px;font:11.0px Menlo"><span style="color:#bb2d9d">for</span>(<span style="color:#bb2d9d">unsigned</span> <span style="color:#4e8186">i</span>=<span style="color:#2c2ecf">0</span>; <span style="color:#4e8186">i</span><num; ++<span style="color:#4e8186">i</span>){</p>

<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Menlo"><span class="Apple-tab-span" style="color:rgb(0,0,0);white-space:pre">               </span><font class="Apple-style-span" color="#3e1f7c">NSLog</font><span style="color:rgb(0,0,0)">(</span><font class="Apple-style-span" color="#d12c26">@"Decoded data a a a a a[%d]=%s\n."</font><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(78,129,134)">i</span><span style="color:rgb(0,0,0)">,sps[</span><span style="color:rgb(78,129,134)">i</span><span style="color:rgb(0,0,0)">].sPropBytes);<span class="Apple-tab-span" style="white-space:pre">          </span></span></p>

<p style="margin:0px 0px 0px 0px;font:11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">     </span>}</p></span></div><div><br></div><div>results:</div><div><br></div><div><p style="margin:0px 0px 0px 28.0px;font:11.0px Menlo">
<b>2012-01-31 19:19:47.483 rtsp[388:6c03] Decoded data a a a a a[0]='M@©6>…‡</b></p>
<p style="margin:0px 0px 0px 28.0px;font:11.0px Menlo"><b>AÄA≠∞≠{fl</b></p>
<p style="margin:0px 0px 0px 28.0px;font:11.0px Menlo"><b>.</b></p>
<p style="margin:0px 0px 0px 28.0px;font:11.0px Menlo"><b>2012-01-31 19:19:47.484 rtsp[388:6c03] Decoded data a a a a a[1]=(fi<span class="Apple-tab-span" style="white-space:pre">    </span>à</b></p><p style="margin:0px 0px 0px 28.0px;font:11.0px Menlo">
<b><br></b></p><p style="margin:0px 0px 0px 28.0px;font:11.0px Menlo"><b><span class="Apple-style-span" style="font-family:arial;font-size:small;font-weight:normal">I think these two strings must be SPS and PPS right? I m going to use it as the extradata and send to ffmpeg decoder. Do I need to put something like 00000001 in front of each string?</span></b></p>
<p style="margin:0px 0px 0px 28.0px;font:11.0px Menlo"><b><span class="Apple-style-span" style="font-family:arial;font-size:small;font-weight:normal"><br></span></b></p><p style="margin:0px 0px 0px 28.0px;font:11.0px Menlo">
<b><span class="Apple-style-span" style="font-family:arial;font-size:small;font-weight:normal">Thank you very much</span></b></p><p style="margin:0px 0px 0px 28.0px;font:11.0px Menlo"><b><span class="Apple-style-span" style="font-family:arial;font-size:small;font-weight:normal">Best regards</span></b></p>
<p style="margin:0px 0px 0px 28.0px;font:11.0px Menlo"><b><span class="Apple-style-span" style="font-family:arial;font-size:small;font-weight:normal"><br></span></b></p><p style="margin:0px 0px 0px 28.0px;font:11.0px Menlo">
<b><span class="Apple-style-span" style="font-family:arial;font-size:small;font-weight:normal">James</span></b></p><p style="margin:0px 0px 0px 28.0px;font:11.0px Menlo"><b><br></b></p><p style="margin:0px 0px 0px 28.0px;font:11.0px Menlo">
<b><br></b></p><p style="margin:0px 0px 0px 28.0px;font:11.0px Menlo"><b><br></b></p><p style="margin:0px 0px 0px 28.0px;font:11.0px Menlo"><b><br></b></p><br><div class="gmail_quote">On 31 January 2012 18:52, Ross Finlayson <span dir="ltr"><<a href="mailto:finlayson@live555.com">finlayson@live555.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">G'day James, it's nice to hear from another University of Auckland person.<div>
<div><div class="im"><br><blockquote type="cite"><div><span style="color:rgb(42,42,42);font-family:Verdana,Simsun,Tahoma,Arial,sans-serif;font-size:12px;line-height:15px"><div style="line-height:15px">I have a question about <span style="line-height:14px;font-family:Menlo;font-size:11px">parseSPropParameterSets() function.</span></div>
<div style="line-height:15px">
<span style="line-height:14px;font-family:Menlo;font-size:11px"><br style="line-height:14px"></span></div><div style="line-height:15px"><span style="line-height:14px;font-family:Menlo;font-size:11px">Based on my understanding, I think this function will read in the SPS and PPS data,</span></div>
</span></div></blockquote><div><br></div></div>Yes, it will read in a coded ASCII string that represents the SPS and PPS NAL units.</div><div><br></div><div><div class="im"><br><blockquote type="cite"><div><span style="color:rgb(42,42,42);font-family:Verdana,Simsun,Tahoma,Arial,sans-serif;font-size:12px;line-height:15px"><div style="line-height:15px">
<span style="line-height:14px;font-family:Menlo;font-size:11px">then do base64 decode to generate a nal unit.</span></div>
<div style="line-height:15px"><span style="line-height:14px;font-family:Menlo;font-size:11px"><br style="line-height:14px"></span></div><div style="line-height:15px"><font face="Menlo" style="line-height:normal"><span style="line-height:14px;font-size:11px">I have fit the SPS and PPS data by using this </span></font></div>

<div style="line-height:15px"><span style="line-height:14px;font-family:Menlo;font-size:11px"><p style="line-height:normal;margin-top:0px;margin-right:0px;margin-bottom:1.35em;margin-left:0px;font:normal normal normal 11px/normal Menlo;color:rgb(187,45,157)">

<br style="line-height:14px"></p><p style="line-height:normal;margin-top:0px;margin-right:0px;margin-bottom:1.35em;margin-left:0px;font:normal normal normal 11px/normal Menlo;color:rgb(187,45,157)">unsigned<span style="line-height:14px;color:rgb(0,0,0)"> </span>int<span style="line-height:14px;color:rgb(0,0,0)"> num=</span><span style="line-height:14px;color:rgb(44,46,207)">0</span><span style="line-height:14px;color:rgb(0,0,0)">;  </span></p>
<p style="line-height:normal;margin-top:0px;margin-right:0px;margin-bottom:1.35em;margin-left:0px;font:normal normal normal 11px/normal Menlo">SPropRecord * sps=parseSPropParameterSets(context->subsession->fmtp_spropparametersets(),num);</p>
</span></div></span></div></blockquote></div><div>After the call, "sps" will be an array of "num" "SPropRecord"s - each one containing the data for a NAL unit (usually SPS or PPS).  So you can do, for example:</div>
<div><br></div><div><span style="white-space:pre-wrap"> </span>for (unsigned i = 0; i < num; ++i) {</div><div><span style="white-space:pre-wrap">          </span>unsigned nalUnitSize = sps[i].sPropLength;</div><div><span style="white-space:pre-wrap">               </span>unsigned char* nalUnitBytes = sps[i].sPropBytes;  // this is a byte array, of size "nalUnitSize".</div>
<div><span style="white-space:pre-wrap">          </span>// Then do whatever you like with this NAL unit data</div><div class="im"><div><span style="white-space:pre-wrap">     </span>}</div><br><div><br></div><blockquote type="cite">
<div><span style="color:rgb(42,42,42);font-family:Verdana,Simsun,Tahoma,Arial,sans-serif;font-size:12px;line-height:15px"><div style="line-height:15px">My question is how can i store </div><div style="line-height:15px"><br style="line-height:15px">
</div><div style="line-height:15px"><span style="line-height:14px;font-family:Menlo;font-size:11px"> SPropRecord * data to a NSData and send into extradata to decode?</span></div></span></div></blockquote><div><br></div></div>
I don't know what a "NSData" is (it's apparently something outside our libraries), but I hope it should be obvious from the implementation of the function in "liveMedia/H264VideoRTPSource.cpp" how it works.</div>
</div><span class="HOEnZb"><font color="#888888"><br><br><div>
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">Ross Finlayson<br>
Live Networks, Inc.<br><a href="http://www.live555.com/" target="_blank">http://www.live555.com/</a></span></span>
</div>
<br></font></span></div><br>_______________________________________________<br>
live-devel mailing list<br>
<a href="mailto:live-devel@lists.live555.com">live-devel@lists.live555.com</a><br>
<a href="http://lists.live555.com/mailman/listinfo/live-devel" target="_blank">http://lists.live555.com/mailman/listinfo/live-devel</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>James Zhang<br><br>BE (Hons)<br>Department of Electrical and Computer Engineering<br>THE UNIVERSITY OF AUCKLAND<br>
</div>