User Tools

Site Tools


transport_stream_analysis

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
transport_stream_analysis [2017/01/06 08:50] – created walkeradmintransport_stream_analysis [2023/03/09 22:35] (current) – external edit 127.0.0.1
Line 15: Line 15:
 \\  \\ 
 \\  \\ 
-{{:tsa01.jpg?400|}}+{{:tsa01.jpg?500|}}
 \\  \\ 
 \\  \\ 
Line 21: Line 21:
 \\  \\ 
 \\  \\ 
-{{:tsa02.jpg?300|}}+{{:tsa02.jpg?500|}}
 \\  \\ 
 \\  \\ 
Line 28: Line 28:
  
 Sync Byte 8 01000111 0x47 Sync Byte Sync Byte 8 01000111 0x47 Sync Byte
-TS Error 1 0 0x00 Error indicator (0=No Error, 1=Error)+TS Error 1 0 0x00 Error indicator (0=No Error, 1=Error)
 Start Indicator 1 0 0x00 1 means start of PES or PSI otherwise 0 Start Indicator 1 0 0x00 1 means start of PES or PSI otherwise 0
-Transport Priority 1 0 0x00 see table below+Transport Priority 1 0 0x00 see table below
 PID 13 1111111111111 1FFF 8191 PID is 8191 (1FFF) = stuffing packet PID 13 1111111111111 1FFF 8191 PID is 8191 (1FFF) = stuffing packet
 Scrambling 2 00 0x00 00 = not scrambled Scrambling 2 00 0x00 00 = not scrambled
Line 38: Line 38:
 Total 32 Total 32
 </file> </file>
 +\\ 
 +\\ 
 +Looking at the bits of the example TS Header tells us a few things about the packet we are analysing. Importantly we can see this packet has no (apparent) errors, the PID tells us it is a stuffing packet, there is no adaptation field and we have a continuity counter that helps us determine whether there are any missing packets.
 +\\ 
 +\\ 
 +{{:ts_header.jpg?600|}}
 +\\ 
 +\\ 
 +In the above diagram it can be seen that the overall format of the TS packet is as follows:
 +\\ 
 +\\ 
 +TS Header -> Adaptation Field -> Data Payload
 +\\ 
 +\\ 
 +A PES packet is a TS packet that has had its TS and Adaptation components removed (so the payload basically) and the PES packet has a 32bit (4 Byte) PES header.
 +\\ 
 +\\ 
 +
 +----
 +
 +==== PCR PTS DTS ====
 +\\ 
 +The PCR is a sample of the Encoders 27Mhz clock, the PCR comprises of 33bits + 9 bits. 
 +\\ 
 +\\ 
 +The format of the 42-bit 27MHz clock is slightly peculiar in that the 33 MSBs count normally at a rate of 90kHz and the 9 LSBs count mod 300 (i.e.0-299). This strange arrangement allows a 27MHz clock, which is readily compatible with the 90kHz time stamps in the program material.
 +\\ 
 +\\ 
 +PCR is for the synchronization of the decoders clock, the 27Mhz clock in the Encoder is sampled, and this is used to synchronise the 27Mhz clock in the decoder. With the clocks in sync (so any error on the Encoder clock is also on the decoder clock) the timestamps in the PTS and DTS will still match the decoded PCR.
 +\\ 
 +\\ 
 +For DVB Transport Streams the a PCR needs to be present every 40mS (so every frame). 
 +\\ 
 +\\ 
 +The DTS is the Decode Timestamp, while the encoding process GoP might be IBBP, the frames can not be decoded in that order, so encoder frames are reordered and time stamped in their Decode order.
 +\\ 
 +\\ 
 +Below is an example, the I frame must be decoded first, then P frame can then be decoded, once the I and P are decoded the B frames can then also be decoded. So the correct decode order is IPBB.
 +\\ 
 +\\ 
 +{{:ipbb.jpg?300|}}
 +\\ 
 +\\ 
 +The PTS is the Presentations Timestamp, this is the order in which the frames must be displayed (presented) to the user (the screen)
 +\\ 
 +\\ 
 +{{:ibbp.jpg?300|}}
 +\\ 
 +\\ 
 +So having PTS and DTS timestamps in the PES header allows the decoder to decode and display the frames in the correct order.
 +\\ 
 +\\ 
 +The PTS and DTS are 33bit, 90kHz versions of the clock.
 +\\ 
 +\\ 
 +
 +----
 +==== Transport Stream Packet Description ====
 +\\ 
 +{{:transport_stream_packet_description_01.jpg?650|}}
 +\\ 
 +\\ 
 +
 +----
 +==== Adaption Field Format Description ====
 +\\ 
 +{{:adaption_field_format_description_01.jpg?650|}}
 \\  \\ 
 \\  \\ 
  
transport_stream_analysis.1483692604.txt.gz · Last modified: 2023/03/09 22:35 (external edit)