video – Can someone parse this H264/AVC SPS payload?

I am trying to parse this SPS payload to understand the H264 codec better, I am successful for the most part, but having hard time parsing or understanding num_units_in_tick and time_scale details for the following payload:

67 64 00 28 AC 2B 40 2C 01 0B CB 26 02 20 00 00 03 00 20 00 00 04 01 B4 11 08 D4

There is no code yet, I first practice by manually parsing the bits I show above.

I am following the latest H264 spec detailed in the MPEG documentation: www.mpeg.org/standards/MPEG-4/10/

When I double-check with some established 3rd party SPS parsers like FFmpeg, they give:

num_units_in_tick = 1
time_scale = 32
fixed_frame_rate_flag = 0

But when I parse manually as per the spec I get:

num_units_in_tick = 24 = (0 0000 0000 0000 0000 0000 0000 0011 000 - 108th bit to 139th bit)
time_scale = 16777216 = (0 0000 0010 0000 0000 0000 0000 0000 000 - 140th bit to 171st bit)
fixed_frame_rate_flag = 0 (0 - 172nd bit)

Can someone correct or affirm my understanding of this parsing.

Read more here: Source link