A Basic Guide to Transport StreamsTransport Stream Structure
TimecodesA transport stream needs timing information to make sure Video and Audio are shown at the right time and in sync.
The most important timecodes are:
If the PTS or DTS timestamps are corrupted, the decoder can use the PCR to recreate the corrupted timestamps.
The PCR always increments linearly so can also be used to seek video.
For greater accuracy, the PCR has an extension which increases the resolution to 27MHz (instead of 90KHz for PTS and DTS)
There can be a PCR present for each Programme (PMT) or there can be one PCR for the entire Transport stream. In this case, the PCR is usually carried on a separate PID, commonly 0x1FFE or 0x1FE.
The PCR can also be present on the Video PID for a Programme (PMT) or on the audio PID in the case of a radio programme.
The PMT points to the PID which carries the PCR timestamps.
The PCR is essential for correct decoding of the Transport Stream
The PTS is present for elementary streams such as Video, Audio & Subtitles.
The DTS is present for elementary streams such as Video, Audio & Subtitles.
The DTS is slightly ahead of the PTS to allow the decoder time to decode the frame before the decoder needs to present it.