5

I'm trying to extract the PCR time value from an MPEG-TS packet. According to wiki, the PCR contains 33+6+9 number of bits and also it states that the first 33 bits are based on a 90 kHz clock while the last 9 are based on a 27 MHz clock. I extract the bits that follows adaptation field byte, when the PCR flag is enabled.

The question is, how do I calculate the PCR time stamp value with this 48 (33+6+9) bits I have, by considering the respective clock frequency values.

Thanks.

userDtrm
  • 533
  • 2
  • 7
  • 20

2 Answers2

3
PCR(i) = PCR_base(i)*300 + PCR_ext(i)

Where (i) is the index of the byte containing the last bit of the program_clock_reference_base field.

Source:

Community
  • 1
  • 1
n0p
  • 3,399
  • 2
  • 29
  • 50
1

Depending of the accuracy needed by your application, you can work only with the 90kHz clock. The 27Mhz component is used to detect drift in a broadcasting environment.

Tryum
  • 660
  • 7
  • 22