[Live-devel] get H.264 frame width and height out of SPS

Roland Aigner Roland.Aigner at aec.at
Thu Mar 23 06:28:25 PDT 2017


Hi,

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.

On the FAQ section on live555.com I found the following:

"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 "include/H264VideoRTPSource.hh<http://www.live555.com/liveMedia/doxygen/html/H264VideoRTPSource_8hh.html>"), to generate binary NAL units for your decoder."

Unfortunately, I cannot figure out where to go from here. For example, I get the following SPS
Z2QAKKwrQDwBE/LgIgAAB9AAAdTBHjhlQA==,aO48sA==
which apparently contains two SPropRecord entries of 25 and 4 bytes length, respectively:
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
0x68 0xee 0x3c 0xb0

I found a few sites on the web, giving brief explanations but every one of them gets ma stuck at some point.

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.

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20170323/278f95b1/attachment.html>


More information about the live-devel mailing list