On Sat, Feb 6, 2010 at 11:34 AM, Tom Pepper &lt;<a href="mailto:tom@silocorp.com">tom@silocorp.com</a>&gt; wrote:<br>&gt; Jeremy:<br>&gt;<br>&gt; Thanks for the quick response.  I&#39;ve had difficulty locating a good source of information on what the parameter sets should look like, so that&#39;s probably the issue.<br>
&gt;<br>&gt; MainConcept provides them via h264OutVideoGetParSets().  Here&#39;s the code I use to retrieve them and parse:<br>&gt;<br>&gt;                // get AVC Parameter Sets<br>&gt;                char * parset = (char *) malloc(1024);<br>
&gt;                int length;<br>&gt;<br>&gt;                if(h264OutVideoGetParSets(v_encoder, &amp;v_settings, (uint8_t *) parset, &amp;length)) {<br>&gt;                  fprintf(stderr,&quot;h264OutVideoGetParSets() failed!&quot;);<br>
&gt;                  exit(-1);<br>&gt;                }<br>&gt;                fprintf(stderr, &quot;h264OutVideoGetParSets: %i\n&quot;, length);<br>&gt;                hexdump(parset, length);<br>&gt;<br>&gt;                char *b64parset = base64Encode(parset + 4, length - 4); // skip sync<br>
&gt;                fprintf(stderr, &quot;b64parset: %s, %zu\n&quot;, b64parset, strlen(b64parset));<br>&gt;<br>&gt;                unsigned int numrecords = 0;<br>&gt;                SPropRecord* poo = parseSPropParameterSets(b64parset, numrecords);<br>
&gt;<br>&gt;                for (unsigned i = 0; i &lt; numrecords; ++i) {<br>&gt;                        fprintf(stderr, &quot;decoded [%i] = %s\n&quot;, i, poo[i].sPropBytes);<br>&gt;                }<br><br>The problem is that you&#39;re base64 encoding both SPS and PPS info in one big block--the two are supposed to be individually base64 encoded, and then delimited with a comma.  In other words, the final entry should look like:<br>
<br>sprop-parameter-sets=spsInBase64,ppsInBase64<br><br>On the client side, it splits this string on the comma character and then decodes each side separately.<br><br>It does look like h264OutVideoGetParSets() delimits the output with NAL start codes (0x00000001), so splitting the parameter sets apart shouldn&#39;t be too difficult.  If you want to identify SPS and PPS separately, that&#39;s a bit more work to parse the NAL unit headers (see H264 specification if you need to do this--it&#39;s a few lines of bit-twiddling, more or less).<br>