<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
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
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
span.apple-tab-span
{mso-style-name:apple-tab-span;}
span.apple-style-span
{mso-style-name:apple-style-span;}
span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thank you ross and chris. It works !! </span><span style='font-size:11.0pt;font-family:Wingdings;color:#1F497D'>J</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></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 [mailto:live-devel-bounces@ns.live555.com] <b>On Behalf Of </b>Ross Finlayson<br><b>Sent:</b> Thursday, May 01, 2014 10:57 PM<br><b>To:</b> LIVE555 Streaming Media - development & use<br><b>Subject:</b> Re: [Live-devel] Frames are corrupted<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On May 1, 2014, at 9:58 AM, Vikram Singh <<a href="mailto:vikram@vizexperts.com">vikram@vizexperts.com</a>> wrote:<o:p></o:p></p></div><p class=MsoNormal><br><br><o:p></o:p></p><div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi ross,</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I am not able to get SPS and PPS units from the encoder.</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I am using CUDA Video Encode library which has a function NVGetSPSPPS().</span><o:p></o:p></p></div></div><p class=MsoNormal>[...]<o:p></o:p></p></div><div><div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:red'> </span><o:p></o:p></pre><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Sorry I am not getting the detailed documentation for the function NVGetSPSPPS(). Please help me.</span><o:p></o:p></p></div></div></blockquote></div></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>"NVGetSPSPPS()" is not a function in our code, so I don't know why you're asking here. Why don't you ask whoever provided you the "CUDA Video Encode library"?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>However...<o:p></o:p></p></div><div><p class=MsoNormal><br><br><o:p></o:p></p><div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>NVGetSPSPPS() returns a buffer to SPS and PPS.</span><o:p></o:p></p></div></div></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The problem is that I don’t have the formatting for this buffer so that I could separate SPS and PPS units from each other.</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>In my case this buffer is</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> 00 24<span class=apple-converted-space> </span></span><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'>67</span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:red'>4d 40 1e f6 04 00 83 7f e0 00 80 00 62 00 00 07 d2 00 01 d4 c1 c0 00 00 27 a1 20 00 02 62 5a 17 79 70 50 00 04<span class=apple-converted-space> </span></span><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'>68</span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:red'>ee 3c 80</span><o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>It seems quite clear that the encoding is:<o:p></o:p></p></div><div><p class=MsoNormal><span class=apple-tab-span> </span>Sequence of:<o:p></o:p></p></div><div><p class=MsoNormal><span class=apple-tab-span> </span>2-byte 'length' (in big-endian order)<o:p></o:p></p></div><div><p class=MsoNormal><span class=apple-tab-span> </span>'length' bytes, containing the NAL unit (without a preceding 'start code')<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> According to my assumption </span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> </span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> 00 00 00 01 </span><b><span style='font-size:12.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>67 </span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:red'>4d 40 1e f6 04 00 83 7f e0 00 80 00 62 00 00 07 d2 00 01 d4 c1 c0 00 00 27 a1 20 00 02 62 5a 17 79 70 50 00 04 ==> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>sps</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>And 00 00 00 01 </span><b><span style='font-size:12.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>68</span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:red'>ee 3c 80 ==> pps</span><o:p></o:p></pre></div></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>Not quite, because it seems clear that the "00 24" is a length field (i.e., 0x0024 == 36 decimal). Therefore SPS is<o:p></o:p></p></div><div><p class=MsoNormal><span class=apple-tab-span> </span>67 4d 40 1e f6 04 00 83 7f e0 00 80 00 62 00 00 07 d2 00 01 d4 c1 c0 00 00 27 a1 20 00 02 62 5a 17 79 70 50<o:p></o:p></p></div><div><p class=MsoNormal>then the next two bytes - 00 04 - are also a length field (therefore, *not* part of the NAL unti), so PPS is<o:p></o:p></p></div><div><p class=MsoNormal><span class=apple-tab-span> </span>68 ee 3c 80<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>You should therefore pass these two NAL units - without start codes - as parameters to<o:p></o:p></p></div><div><p class=MsoNormal><span class=apple-tab-span> </span>H264VideoRTPSink::createNew()<o:p></o:p></p></div><div><p class=MsoNormal>This will be the second form of "H264VideoRTPSink::createNew()" - i.e., the form that has the signature<o:p></o:p></p></div><div><p class=MsoNormal><span class=apple-tab-span> </span>static H264VideoRTPSink* createNew(UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat,<br><span class=apple-tab-span> </span>u_int8_t const* sps, unsigned spsSize,<o:p></o:p></p></div><div><p class=MsoNormal><span class=apple-tab-span> </span>u_int8_t const* pps, unsigned ppsSize,<br><span class=apple-tab-span> </span>unsigned profile_level_id);<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Note that you also need to pass a "profile_level_id" parameter. This is actually a flaw in the code, because you can generate this parameter from the 2nd through 4th bytes of the SPS NAL unit. (I.e., this parameter shouldn't be needed.) So, in your case, the "profile_level_id" parameter would be<o:p></o:p></p></div><div><p class=MsoNormal><span class=apple-tab-span> </span>0x4d401e<o:p></o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><div><p class=MsoNormal><span class=apple-style-span><span style='font-family:"Helvetica","sans-serif";color:black'>Ross Finlayson</span></span><span style='font-family:"Helvetica","sans-serif";color:black'><br><span class=apple-style-span>Live Networks, Inc.</span><br><span class=apple-style-span><a href="http://www.live555.com/">http://www.live555.com/</a></span></span> <o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p></div></body></html>