<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 15 (filtered medium)">
<style><!--
/* Font Definitions */
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.E-MailFormatvorlage17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
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="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am trying to figure out how to get the frame width and height out of a H.264 stream and I’m having some difficulties understanding how to decode a SPS.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">On the FAQ section on live555.com I found the following:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt"><span style="font-size:13.5pt;color:black">“If you are receiving H.264 video data, there is one more thing that you have to do before you start feeding frames to your decoder. H.264 streams have out-of-band configuration
information ("SPS" and "PPS" NAL units) that you may need to feed to the decoder to initialize it. To get this information, call "MediaSubsession::fmtp_spropparametersets()" (on the video 'subsession' object). This will give you a (ASCII) character string.
You can then pass this to "parseSPropParameterSets()" (defined in the file "</span><a href="http://www.live555.com/liveMedia/doxygen/html/H264VideoRTPSource_8hh.html"><span style="font-size:13.5pt">include/H264VideoRTPSource.hh</span></a><span style="font-size:13.5pt;color:black">"),
to generate binary NAL units for your decoder.”</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Unfortunately, I cannot figure out where to go from here. For example, I get the following SPS<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">Z2QAKKwrQDwBE/LgIgAAB9AAAdTBHjhlQA==,aO48sA==<o:p></o:p></p>
<p class="MsoNormal">which apparently contains two SPropRecord entries of 25 and 4 bytes length, respectively:<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">0x67 0x64 00 0x28 0xac 0x2b 0x40 0x3c 0x1 0x13 0xf2 0xe0 0x22 00 00 0x7 0xd0 00 0x1 0xd4 0xc1 0x1e 0x38 0x65 0x40<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">0x68 0xee 0x3c 0xb0<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I found a few sites on the web, giving brief explanations but every one of them gets ma stuck at some point.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Given that I would expect this to be a quite common task, I wanted to ask if there are some helper classes/functions in live555 that already prase the SPS and give me what I want. Otherwise, I would appreciate pointing me to a helpful source.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks!<o:p></o:p></p>
</div>
</body>
</html>