How Timestamp Validation Helps Provide the Best Streaming Experience

By Community Team

Alexander Kruglov, a leading engineer at Elecard, shares his experience on timestamp validation in Transport Stream (TS), the most widely used media data streaming format in IPTV, DVB/ATSC, and over-the-top (OTT) digital TV networks.

Timestamp validation is essential for maintaining synchronization between different media types, ensuring a high-quality streaming experience. In this Q&A, Alexander discusses the TS generation process, timestamp validation methodology, and shares instructions and screenshots on how to utilize a tool that aids in transport stream analysis.

Why do we need timestamps in Transport Streams (TS)?

Timestamps are crucial for generating, broadcasting, and playing back transport streams. They ensure synchronization between video, audio, and other media data, which is vital for providing a seamless and high-quality streaming experience.

What kind of timestamps are used in TS? Where are they indicated?

The Presentation Time Stamp (PTS) specifies the time at which the relevant elementary stream should be played. In general, each Packetized Elementary Stream (PES), such as a video frame, audio sample, teletext page, or closed caption, has at least one timestamp. Multiplexers, DVB/ATSC modulators, and OTT packetizers need PTS to synchronize video, audio, and other types of Elementary Streams.

The Decoding Time Stamp (DTS) indicates when the video frame should be decoded. It is specified if its value differs from the PTS. Program Clock Reference (PCR) timestamps create a continuous timescale (clock) that contains PTS and DTS values. They are given in the headers of TS packets. PCR stamps are used to keep the clocks on the transmitter and receiver sides in sync.

How are timestamps validated?

Firstly, we validate TS against ETSI TR 101-290. It is a technical specification for the DVB digital TV standard, defining three priorities; timestamp errors are assigned the second priority. ATCS has a comparable specification. Its method for timestamp validation differs in that it contains many threshold values for each error, but the base threshold values are the same. The similar method is used to validate TS in IPTV and OTT networks. We use the Elecard Stream Analyzer application that checks files and reports any faults in a TR 101-290 window.

In most cases, an ETSI TR 101-290 validation is enough but not full, thus we move to the next stage — visual analysis of timestamp dynamics. And in the end, we check timestamp sequencing.

Could you describe errors stated in ETSI TR 101-290?

Sure. The PCR discontinuity indicator error arises when the delta between two successive PCR values goes above 100 ms. The deviation of the expected PCR value indicates PCR (positioning) accuracy in the chosen program. An error is identified when this deviation surpasses a threshold of 500 ns. The more precise the PCR positioning, the more seamless the broadcast.

ETSI TR 101-290 errors

PTS error takes place if the PTS timestamp repetition period reaches 700 ms. Take a video stream with a frame rate of 25, which means it displays 25 frames per second. The display period of one frame, or the difference between two successive PTS timestamps, is 40 ms at this rate. According to the standard, an error is recognized when the PTS delta exceeds 700 ms. Although deltas ranging from 41 milliseconds to 700 milliseconds do not qualify as faults, such long timings suggest a lack of data – otherwise speaking, broadcast gaps.

There is also a PCR Repetition error, which, by the way, was removed from the specification as its threshold value was too strict.

How does visual analysis of timestamp dynamics help identify potential issues?

Visual analysis of timestamp dynamics can detect deviations from the reference plot, which often indicates multiplexing problems caused by issues in the input stream or incorrect transcoder/multiplexer settings. By addressing these deviations, broadcasters can prevent streaming problems and improve overall transmission quality.

PTS, DTS, and PCR dynamics

Stream Analyzer can create such plots. Reference timestamp plots should be straight lines, and deviations may show issues with multiplexing or settings. As for OTT playback, merged HLS TS chunks should form a continuous straight line.

Why is it important to validate timestamp sequencing even when no errors are found in previous stages of analysis?

Additional timestamp sequencing validation is necessary because errors undetected during ETSI TR 101-290 validation and linear timing plot analysis may still cause issues related to buffering and synchronization. Using the Time Dynamics tool in Stream Analyzer, you can identify and address these issues to ensure a smooth streaming experience.

We check the total variation between the Video and Audio timestamps, and the variation between PTS and PCR timestamps for the same point in time. The greater the delta, the larger the buffer that is needed for data synchronization. The working range is up to 1 second. Exceeding the threshold can lead to delays, problems with TS generation, streaming, playback issues such as jerky or freezing pictures, and loss of video to audio synchronization.

It is critical to notice that the plot shouldn’t demonstrate a growing or a declining trend in the delta, as this would imply a steady divergence of timestamps, which would undoubtedly result in the difficulties described above.

Variation of Video/Audio PTS timestamps

Then we check the difference between PTS and DTS. Under typical conditions, the plot appears to be constant, however small shifts in the upper region are acceptable. The divergence of timestamps is indicated by an upward or decreasing trend. Negative deltas indicate that the DTS value is larger than the PTS, which should not be the case. Both alternatives may result in synchronization issues on both the sending and receiving ends.

The next step is to examine the Offset/PCR Dynamics plot, which displays the differences between the positions of TS packets containing PCR timestamps and illustrates how evenly PCR values are distributed in the stream. The plot should be constant. In practice, upward and downward fluctuations around a given average value are normal, but the plot should not exhibit a clear upward or downward trend.

Finally, we study the PCR Accuracy plot, which represents the deviation of PCR values from the expected ones for the specified program. If the shift exceeds 500 ns, the second-priority PCR accuracy error is identified. Since PCR positioning accuracy impacts the overall bitrate of the program, DVB/ATSC modulators are very sensitive to this inaccuracy.

What tools do you use to analyze and validate timestamps?

To analyze timestamps in a captured file, you can use Elecard Stream Analyzer, which is part of StreamEye Studio toolset, it is a professional tool for syntax analysis of encoded media streams and transport stream validation. Feel free to request a demo and see how it can help identify potential synchronization issues and perform troubleshooting for IPTV, DVB/ATSC, and OTT digital TV networks.

As for timestamps in live broadcasting, you can try Elecard Boro, it is a monitoring solution for IPTV and OTT. It provides TR 101-290 validation together with many other compliance checks. Also it can do manual/automated records for further deep analysis in file-based analyzers.

About Elecard

Elecard is a leading technology company specializing in video compression solutions and media stream analysis tools. Elecard has successfully deployed its solutions in a wide range of projects, contributing to the seamless delivery of high-quality video content.

Their extensive experience in participating in high-scale projects has earned Elecard a reputation as a trusted partner in the broadcasting, IPTV, and OTT industries. Whether it’s optimizing video encoding and packaging for broadcasting operations or providing essential tools for media stream analysis, Elecard’s involvement in major projects has consistently delivered reliable and efficient solutions to meet the demands of modern media streaming. With a commitment to innovation and quality, Elecard continues to be a go-to choice for organizations seeking expertise in project deployment and participation in high-scale video delivery initiatives.

Related Categories

Comments are closed.