Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1363938
  • 博文数量: 284
  • 博客积分: 3251
  • 博客等级: 中校
  • 技术积分: 3046
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-26 17:23
文章分类

全部博文(284)

文章存档

2019年(2)

2018年(5)

2015年(19)

2014年(13)

2013年(10)

2012年(235)

分类:

2012-09-27 15:54:44

原文地址:MPEG-2 Transport Stream 作者:txgc_wm

Transport stream (TS) is a format specified in Part 1, Systems (ISO/IEC standard 13818-1). Its design goal is to allow multiplexing of digital video and audio and to synchronize the output. Transport stream offers features for error correction for transportation over unreliable media, and is used in broadcast applications such as and .

Some Important Elements of a Transport Stream Packet

A packet is the basic unit of data in a transport stream. It consists of a sync byte, whose value is 0x47, followed by three one-bit flags and a 13-bit PID. This is followed by a 4-bit continuity counter, which usually increments with each subsequent packet of a frame, and can be used to detect missing packets. Additional optional transport fields, whose presence may be signalled in the optional adaptation field, may follow. The rest of the packet consists of payload. Packets are most often 188 bytes in length, but some transport streams consist of 204-byte packets which end in 16 bytes of error correction data. The 188-byte packet size was originally chosen for compatibility with ATM systems.

PID

Each table or elementary stream in a transport stream is identified by a 13-bit PID. A extracts elementary streams from the transport stream in part by looking for packets identified by the same PID. In most applications, will be used to decide how often a particular PID appears in the transport stream.

Programs

Transport stream has a concept of programs, which are groups of one or more PIDs that are related to each other. For instance, a transport stream used in digital television might contain three programs, to represent three television channels. Suppose each channel consists of one video stream, one or two audio streams, and any necessary metadata. A receiver wishing to tune to a particular "channel" merely has to decode the payload of the PIDs associated with its program. It can discard the contents of all other PIDs.

PAT

PAT stands for Program Association Table. The PAT lists PIDs for all PMTs in the stream. Packets containing PAT information always have PID 0x0.

PMT

Program Map Tables, or PMTs, contain information about programs. For each program, there is a PMT, with the PMT for each program appearing on its own PID. The PMTs describe which PIDs contain data relevant to the program. PMTs also provide metadata about the streams in their constituent PIDs. For example, if a program contains an video stream, the PMT will list this PID, describe it as a video stream, and provide the type of video that it contains (in this case, MPEG-2). The PMT may also contain additional descriptors providing data about its constituent streams.

PCR

To assist the decoder in presenting programs on time, at the right speed, and with synchronization, programs usually periodically provide a Program Clock Reference, or PCR, on one of the PIDs in the program.

Null Packets

Some transmission schemes, such as those in and , impose strict constant bitrate requirements on the transport stream. In order to ensure that the stream maintains a constant bitrate, a may need to insert some additional packets. The PID 0x1FFF is reserved for this purpose. The payload of null packets may contain any data at all, and the receiver is expected to ignore its contents. As it happens, most multiplexers place all 0's or all F's in these packets, but a few have been seen to insert secret messages for the enjoyment of bored engineers.


阅读(552) | 评论(0) | 转发(0) |
0

上一篇:ffmpeg参数解释

下一篇:Linux Shell常用技巧

给主人留下些什么吧!~~