[Live-devel] playback only working to localhost

Jeremy Noring jnoring at logitech.com
Sat Feb 6 12:01:08 PST 2010


On Sat, Feb 6, 2010 at 11:34 AM, Tom Pepper <tom at silocorp.com> wrote:
> Jeremy:
>
> Thanks for the quick response.  I've had difficulty locating a good source
of information on what the parameter sets should look like, so that's
probably the issue.
>
> MainConcept provides them via h264OutVideoGetParSets().  Here's the code I
use to retrieve them and parse:
>
>                // get AVC Parameter Sets
>                char * parset = (char *) malloc(1024);
>                int length;
>
>                if(h264OutVideoGetParSets(v_encoder, &v_settings, (uint8_t
*) parset, &length)) {
>                  fprintf(stderr,"h264OutVideoGetParSets() failed!");
>                  exit(-1);
>                }
>                fprintf(stderr, "h264OutVideoGetParSets: %i\n", length);
>                hexdump(parset, length);
>
>                char *b64parset = base64Encode(parset + 4, length - 4); //
skip sync
>                fprintf(stderr, "b64parset: %s, %zu\n", b64parset,
strlen(b64parset));
>
>                unsigned int numrecords = 0;
>                SPropRecord* poo = parseSPropParameterSets(b64parset,
numrecords);
>
>                for (unsigned i = 0; i < numrecords; ++i) {
>                        fprintf(stderr, "decoded [%i] = %s\n", i,
poo[i].sPropBytes);
>                }

The problem is that you'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:

sprop-parameter-sets=spsInBase64,ppsInBase64

On the client side, it splits this string on the comma character and then
decodes each side separately.

It does look like h264OutVideoGetParSets() delimits the output with NAL
start codes (0x00000001), so splitting the parameter sets apart shouldn't be
too difficult.  If you want to identify SPS and PPS separately, that's a bit
more work to parse the NAL unit headers (see H264 specification if you need
to do this--it's a few lines of bit-twiddling, more or less).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20100206/e4c8ad42/attachment.html>


More information about the live-devel mailing list