0

I have a video with an unknown frame rate. I need to calculate the frame rate it was encoded for. I am trying to calculate it using the data in SPS but I cannot decode it. The bitstream for the NAL is :

67 64 00 1e ac d9 40 a0 2f f9 61 00 00 03 00 7d 00 00 17 6a 0f 16 2d 96

From an online guide (http://www.cardinalpeak.com/blog/the-h-264-sequence-parameter-set/), I could figure out its profile and level fields, but to figure out everything after the "seq_parameter_set_id" field in the table, I need to know the ue(v). Here is where I get confused. According to this page the "ue(v)" should be called with the value v=32? (why?) What exactly should I feed into the exponential-golomb function? Do I read 32 digits from the beginning of the bitstream, or from after the previously read bytes, to regard it as the "seq_parameter_set_id"? ( My ultimate goal is to decode the VUI parameters so that I can recalculate the framerate.)

Thanks!

user2662165
  • 189
  • 1
  • 1
  • 10

1 Answers1

1

ue = Unsigned Exponential golomb coding.

(v) = variable number of bits.

http://en.wikipedia.org/wiki/Exponential-Golomb_coding

szatmary
  • 29,969
  • 8
  • 44
  • 57
  • Thanks, I guess the 32 didn't make sense there...I still don't know where to start reading the Exp-Golomb codes. From the start or from after the previously read, non exp-golomb fields. Do you know? – user2662165 Dec 10 '14 at 17:28
  • Well, you need to make sure your payload is in RBSP (emulation bytes removed) then start parsing the NALU from the first byte. see section 7.3.1 and 7.3.2.1 in the ISO/IEC 14496-10 spec. If you don't understand what that means, start here: http://szatmary.org/blog/25 – szatmary Dec 10 '14 at 17:42
  • Or use http://h264bitstream.sourceforge.net/ But be careful, this library has a serious bug if your SPS has color matrixes – szatmary Dec 10 '14 at 17:43
  • Thanks so much! This is great. Exactly what I was looking for. It has an implementation of SPS debugger. – user2662165 Dec 10 '14 at 21:00