ES & PES

ES (Elementary stream)

An elementary stream (ES) is usually the output of an audio or video encoder.
ES contains only one kind of data, e.g. audio, video or closed caption.
An elementary stream is often referred to as "elementary", "data", "audio", or "video" bitstreams or streams.

可以看出ES流通常是指编码器的音频或视频输出, 且只能包含一种类型的数据: 如音频数据或视频数据等.

The format of the elementary stream depends upon the codec or data carried in the stream, but will often carry a common header when packetized into a packetized elementary stream.

PES (Packetized Elementary Stream)

PES is a specification that defines carrying of elementary streams in packets within MPEG program streams(PS) and MPEG transport streams(TS).

PES用于定义如何在TS和PS流中以包的形式携带ES流.

The elementary stream is packetized by encapsulating sequential(有序的) data bytes from the elementary stream inside PES packet headers.
A typical method of transmitting elementary stream data from a video or audio encoder:

  • Step1: create PES packets from the elementary stream data.

  • Step2: encapsulate these PES packets inside Transport Stream (TS) packets or Program Stream (PS) packets.

  • PES流是ES流经过PES打包器处理后形成的数据流
    在这个过程中完成了将ES流分组、打包、加入包头信息等操作(对ES流的第一次打包).

  • PES流的基本单位是PES包.

  • PES包由包头和payload组成.

  • PES包只能包含一种类型的ES.
    ES是只含一种内容的数据流,如只含视频或只含音频等,打包之后的PES也是只含一种性质的ES,如只含视频ES的PES,只含音频ES的PES等

Transport Streams and Program Streams are each logically constructed from PES packets.
PES packets shall be used to convert between Transport Streams and Program Streams. In some cases the PES packets need not be modified when performing such conversions.
PES packets may be much larger than the size of a Transport Stream packet.[3]

图示

ES & PES_第1张图片
Paste_Image.png

References:
https://en.wikipedia.org/wiki/Elementary_stream
https://en.wikipedia.org/wiki/Packetized_elementary_stream
http://blog.csdn.net/beyond0824/article/details/19618929
http://wenku.baidu.com/link?url=Xw0LAwQlpXQ9xPk7l9-z52hdb-3lxFSHtdZ_iQoGOESGAT7izoUZs9Ii5rFYVG_zHIzLasf95OIWT_KUdghmc_dJerz0gY0eWZhrfo2EMuO

你可能感兴趣的:(ES & PES)