MPEG Transport Stream Continuity Counters [closed]
Asked Answered
P

1

12

I am troubleshooting an IPTV Layer 3 multicast VPN across a 10GB MPLS network.

Only certain HD channels are experiencing severe freezing and tiling; all other SD and HD channels work fine. Our IPTV video monitoring equipment is detecting and reporting packet loss by monitoring a continuity counter. I have asked every equipment vendor we have and read every .pdf I can find and no one seems to know exactly:

  1. How/when/where an MPEG transport stream continuity counter fits into a transport stream ?
  2. What packets/frames in the transport stream are being counted?
  3. Why does the reported packet loss seem to occur in increments of 16 (0, 16, 32) ?
  4. How can there be an error condition with 0 packet loss ?
  5. How/when/where does the PCR value fit into the transport stream ?
Pytlik answered 19/6, 2014 at 15:29 Comment(0)
M
12

That's a lot of questions ! Let's clarify a bit:

  1. Continuity Counter (CC) is carried in the header of every Transport Packet (TP) of the Transport Stream (TS).
  2. Every TP also has a packet identifier (PID) in the header. Every PID has its own CC. The CC for any given PID is incremented every time the TP has a payload according wikipedia but I think it is actually incremented on every new TP... [EDIT]: CC is only incremented when the payload flag is true (cf Mike Reedel comment below)
  3. Actually since the CC is on 4 bits the value should go from 0x0 to 0xF then start over at 0x0.
  4. Some people are careless about the standards, it can happen that during the multiplexing of the TS that the CC is not correctly incremented: in this case you didn't lose any packet but because the CC is broken, your tool is reporting an error. However the error can happen anywhere during the transmission of the TS, including the monitoring tool that might not sample at the correct rate.
  5. Program Clock Reference (PCR) is a timestamp that is regularly inserted in the TS to provide an accurate 27 Mhz clock to the decoder. It should be repeated every 40ms according to the standards. There is no obligation about the PID carrying the PCR but most of the time it is the Video PID: you need to look at the PMT to find out on which PID the PCR is.

Some references:

Masry answered 16/7, 2014 at 8:20 Comment(4)
On #2, the ContinuityCounter is only incremented when the payload flag is true.Norway
Also the Continuity Counter will not get incremented for duplicate packets or when the discontinuity flag is set. See ISO/IEC 13818-1, Section 2.4.3.3.Norway
I wanted to satisfy myself that what Mike Reedell is saying is true i.e that "the continuity counter is only incremented when the payload flag is true". Using tsduck, with the tsdump utility (and just looking at first three packets for simplicity), packets 0,1 and 2 which are the PAT, PMT and Video(PID481) each have "payload: yes". But the continuity counter only changes to 1 in the Video packet...Johnathon
@Johnathon each PID has its own counter. So you can't compare the CC of the PAT, PMT, Video PID481, etc to each other. The CC only makes sense when looking at packets of the same PID.Unbent

© 2022 - 2024 — McMap. All rights reserved.