[Live-devel] question about parseSPropParameterSets()

James Zhang xzha286 at aucklanduni.ac.nz
Mon Jan 30 22:27:44 PST 2012


Hello Ross

Thank you very much for your fast and nice reply.

After parseSPropParameterSets, I should be able to get sps and pps(in
binary format?)

But when i use print command to print the strings, I got some wired data. I
m not sure why it looks like that:


code:

for(unsigned i=0; i<num; ++i){

NSLog(@"Decoded data a a a a a[%d]=%s\n.",i,sps[i].sPropBytes);

}

results:

*2012-01-31 19:19:47.483 rtsp[388:6c03] Decoded data a a a a a[0]='M@©6>…‡*

*AÄA≠∞≠{fl*

*.*

*2012-01-31 19:19:47.484 rtsp[388:6c03] Decoded data a a a a a[1]=(fi à*

*
*

*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?*

*
*

*Thank you very much*

*Best regards*

*
*

*James*

*
*

*
*

*
*

*
*

On 31 January 2012 18:52, Ross Finlayson <finlayson at live555.com> wrote:

> G'day James, it's nice to hear from another University of Auckland person.
>
> I have a question about parseSPropParameterSets() function.
>
> Based on my understanding, I think this function will read in the SPS and
> PPS data,
>
>
> Yes, it will read in a coded ASCII string that represents the SPS and PPS
> NAL units.
>
>
> then do base64 decode to generate a nal unit.
>
> I have fit the SPS and PPS data by using this
>
>
> unsigned int num=0;
>
> SPropRecord *
> sps=parseSPropParameterSets(context->subsession->fmtp_spropparametersets(),num);
>
> 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:
>
> for (unsigned i = 0; i < num; ++i) {
> unsigned nalUnitSize = sps[i].sPropLength;
> unsigned char* nalUnitBytes = sps[i].sPropBytes;  // this is a byte array,
> of size "nalUnitSize".
> // Then do whatever you like with this NAL unit data
> }
>
>
> My question is how can i store
>
>  SPropRecord * data to a NSData and send into extradata to decode?
>
>
> 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.
>
>
> Ross Finlayson
> Live Networks, Inc.
> http://www.live555.com/
>
>
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel
>
>


-- 
James Zhang

BE (Hons)
Department of Electrical and Computer Engineering
THE UNIVERSITY OF AUCKLAND
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120131/e94de479/attachment-0001.html>


More information about the live-devel mailing list