MPEG TS Error Detection in StreamMonitor
StreamMonitor includes functionality to monitor and diagnose MPEG Transport Stream (MPEG TS) data by detecting various types of stream errors. This manual explains the specific errors that StreamMonitor can detect, along with the methods used for their detection.
StreamMonitor shows dynamic metrics for a predefined time period (can be configured in Settings). This provides a real-time view of stream health, allowing operators to quickly identify transient issues or patterns in errors.
Chart Types
There are two main chart types in StreamMonitor:
- Real-time, FIFO based charts.
- Long term, DB based charts.
PID bitrate chart
The PID Bitrate Chart displays the stream bitrate as a stacked area chart, with each MPEG TS PID (Packet Identifier) represented by its corresponding bitrate. This chart offers a comprehensive visualization of the bitrate distribution across various PIDs in the MPEG TS stream. Each area in the chart reflects the bitrate of a specific PID, enabling operators to easily identify the bitrate distribution of stream components over time and detect the presence or absence of elementary stream packets.
The data for this real-time chart is maintained in a FIFO queue, whose size can be configured using the Bitrate FIFO Length setting in the DB configuration section.
Continuity Errors
Description: Continuity errors occur when there is a break in the sequence of packets in an MPEG TS stream. Each TS packet contains a 4-bit continuity error indicates a packet drop, reordering, or repetition. It can also occur if the stream is restarted. Continuity counter increments with each subsequent packet having the same PID (Packet Identifier).
Detection Method: StreamMonitor checks the continuity counter of every incoming TS packet for each PID. The continuity counter is expected to increase sequentially for consecutive packets (modulus 16). If the counter does not increment as expected, a continuity error is recorded. These errors usually indicate packet loss, reordering or duplication, and they can disrupt the decoding of video, audio or data streams.
PCR Out of Order
Description: The Program Clock Reference (PCR) is used to synchronize the decoding and presentation of MPEG TS streams. PCR values should always be increasing over time. If PCR values regress (i.e., a newer packet has a lower PCR value than a preceding one), it is considered an out-of-order PCR.
A PCR Out of Order error indicates packet reordering, duplication, or a stream switch/restart.
Detection Method: StreamMonitor examines the PCR values extracted from the adaptation fields of TS packets. For each PID carrying PCR, the processor ensures that the PCR values are monotonically increasing. If a lower PCR value is detected after a higher one, an "out-of-order" condition is flagged.
PCR Discontinuity Error
Happens when sequential PCR values differ by more than 100 milliseconds without the discontinuity_indicator flag being set.
PTS Out of Order
Description: The Presentation Time Stamp (PTS) determines when a particular frame should be presented during playback. PTS values should generally increase (in streams without B-frames). A regression in PTS values can lead to frames being dropped.
Detection Method: StreamMonitor monitors PTS values from the PES (Packetized Elementary Stream) headers of the TS packets. For streams without B-frames, PTS values should always increase sequentially. If a PTS value is lower than a previously detected value, an out-of-order PTS error is logged. This error typically results in frames being dropped, shown out of sequence, which may cause playback glitches.
Note: If the stream contains B-frames, PTS values will appear out of order due to frame reordering. This behavior is perfectly normal and does not indicate an error.
Transport Error Indicator (TEI)
Description: Transport Stream errors are indicators of issues during transmission. These errors are flagged in the TS packet header by the Transport Error Indicator bit. If this bit is set, it indicates that the packet contains an error and may not be reliable for decoding.
For example, it is set when a demodulator cannot correct errors from Forward Error Correction (FEC) data, signaling that the packet is corrupt.
Detection Method: StreamMonitor checks the Transport Error Indicator bit in the header of every TS packet. If the bit is set, it increments the Total Transport Stream Errors counter. These errors often arise from issues like signal degradation or data corruption during transmission, potentially impacting the quality of the received stream.
History Bitrate Chart
The History Bitrate Chart visualizes the historical bitrate of the stream over time, including periods of stream interruptions and timeouts. The data is retrieved directly from the database and dynamically adjusted based on the duration of the stream's history. For longer time periods, the data is downsampled to ensure clarity and efficient representation, providing an accurate and comprehensive overview of the stream's performance.
Stream Events Chart
The Stream Events Chart highlights the timeline of stream events, showing when the stream went offline and came back online. It also accounts for situations where the stream monitor itself was shut down and restarted, representing these as offline and online events. The chart provides a clear visualization of the stream's availability and operational status over time, helping to identify patterns or issues with interruptions.
Continuity Counter History Rate Chart
This chart displays the historic error rate for continuity counter errors in the MPEG-TS stream. Continuity errors occur when there is a disruption in the sequence of packets sharing the same PID (Packet Identifier). These errors can result from packet loss, reordering, duplication, or stream restarts. Each TS packet includes a 4-bit continuity counter that increments sequentially; any mismatch in this sequence indicates a continuity error.
Unlike the FIFO real-time chart, which tracks continuity counter errors per PID, this chart aggregates errors across the entire stream multiplex. This provides a consolidated view of the stream's overall integrity over time, making it easier to identify systemic issues affecting the stream as a whole.
PCR Out of Order History
This chart tracks the historical occurrences of PCR (Program Clock Reference) out-of-order errors in the MPEG-TS stream. PCR is critical for synchronizing the decoding and presentation of streams, and its values should always increment over time. An out-of-order PCR occurs when a packet has a lower PCR value than a preceding one, which can indicate packet reordering, duplication, or a stream switch or restart.
Unlike the real-time FIFO chart that uses short-term data, the data for this chart is retrieved from the database, providing a long-term view of PCR out-of-order errors. This allows for deeper analysis of stream synchronization issues over an extended time frame.
PTS Out of Order History
This chart tracks the historical occurrences of PTS (Presentation Time Stamp) out-of-order errors in the MPEG-TS stream. PTS is used to ensure the correct timing of media presentation, and its values should always increase in sequence. An out-of-order PTS occurs when a packet has a lower PTS value than a preceding one, which may indicate packet reordering, duplication, or a stream switch or restart.
Unlike the real-time FIFO chart that uses short-term data, the data for this chart is sourced from the database, providing a comprehensive view of PTS out-of-order errors over an extended period. This long-term analysis helps identify and troubleshoot timing issues that may affect the stream's playback quality.
TS Error Indicator History
This chart shows the historical occurrences of TS (Transport Stream) error indicators in the MPEG-TS stream. The TS error indicator is a flag in the TS packet header that signals issues such as packet corruption or data loss during transmission. These errors can impact the stream's integrity and playback reliability.
Unlike the real-time FIFO chart, which captures short-term data, this chart retrieves data from the database, offering a long-term view of TS error indicators. This historical perspective aids in identifying patterns of transmission errors and diagnosing persistent or recurring issues in the
Summary
The MPEG TS stream errors detected by StreamMonitor are crucial for ensuring the reliability of video, audio and data transmission. By monitoring continuity counters, PCR values, PTS values, and transport stream error indicators, StreamMonitor provides a comprehensive view of stream health, helping to identify and troubleshoot issues that could affect playback quality.
- Continuity Counter Errors: Detects sequence breaks in packet continuity.
- PCR Out of Order: Detects regressions in Program Clock Reference values.
- PTS Out of Order: Detects regressions in Presentation Time Stamp values (if no B-frames are present).
- Transport Error Indicator: Detects packets marked as containing errors.
- Historic Bitrate Chart: Visualizes the stream's bitrate over time, marking interruptions and timeouts.
- Stream Events Chart: Highlights the timeline of stream offline and online events, including stream monitor shutdowns and restarts.
- Continuity Counter Historic Error Rate: Aggregates continuity errors across the entire stream multiplex to show trends in packet sequence disruptions over time.
- PCR Out of Order History: Tracks historical occurrences of out-of-order PCR values to analyze stream interruptions and synchronization issues.
- PTS Out of Order History: Shows the historical trend of PTS out-of-order errors, helping to diagnose stream interruptions and playback timing issues.
- TS Error Indicator History: Provides a long-term view of transport stream errors marked by the TS error indicator flag, aiding in identifying transmission reliability problems.
These metrics help maintain stream integrity and ensure smooth playback, which is particularly important for applications like live broadcasts and mission-critical video feeds.