Header for mpeg packets??

About encoding, codec settings, muxers and filter usage
M.Shimoda

Header for mpeg packets??

Postby M.Shimoda » 09 Nov 2004 20:05

Hi all!
Does anybody could tell me if the VLC adds an special header to the mpeg-1 packets before they are sent? That's the reason why we can receive the media in the middle of transmission?
Thanks in advance

Sigmund
Big Cone-huna
Big Cone-huna
Posts: 893
Joined: 26 Nov 2003 09:38

Postby Sigmund » 09 Nov 2004 23:15

vlc repacks the mpeg1 is mpeg2-ts. that's the reason for you.

M.Shimoda

Postby M.Shimoda » 11 Nov 2004 19:40

Is there any documentation about this?

Sigmund
Big Cone-huna
Big Cone-huna
Posts: 893
Joined: 26 Nov 2003 09:38

Postby Sigmund » 11 Nov 2004 22:20

iso 13818-1 is the standard.

vsipat
Blank Cone
Blank Cone
Posts: 11
Joined: 10 Nov 2004 05:14
VLC version: 1.1.11
Operating System: Linux / Windows
Location: Santa Barbara, Ca, USA
Contact:

Transport Streams

Postby vsipat » 12 Nov 2004 05:27

an MPEG-2 Transport Stream is a multiplexing packet format.

A TS packet has a fixed size (188 Bytes) and is composed of Header+Data. A single TS Packet can contain information about Video, or information about Audio, or information about a timing reference, or TS desription information, or one of several other forms of data encapsulated in the Data portion of the TS packet.

The TS Header defines the type of packet with the PID (Packet Identifier) which is a unique value (13 bits unsigned). There is a lot more to the TS Header than the PID but that is all I am going to describe on this current rant. The Meat and Potatoes of the stream will generally be Video Data, followed by Audio Data, and then an even distribution of Management Table information sent out every second or so. The Video and Audio data are further defined by PES (Packetized Elementary Stream) Headers in the Data Portion of the TS Header which describes the specific encoding information of the Video or Audio in the underlying ESs (Elementary Streams).

The Management tables and the clock reference are presented within the TS Data section in a different way. Starting from the top is the PAT (Program Association Table) which is always defined at PID #0 and describes the PID of the PMT(s) (Program Map Table). The PMT describes the PID values for the associated program(s) within the entire TS Stream. In the most simple and common case there will be only 1 program in the TS Stream and therefore only be need for 1 PMT. The PMT can describe the PID for Video Packets, the PID for Audio Packets, and the PID for the PCR (Program Clock Reference). The PCR is a TS packet containing timestamp information from a 27Mhz Clock running at the encoder. The sending of this PCR data serves as a digital PLL (Phase Loop Lock) between the encoder and decoder devices.

Once the Decoder has received the management data PAT followed by PMT it will have all the information necessary to decode the incoming TS packets based on known PID values. This is why the Stream must repeat these tables frequently so decoder devices can join and exit the stream at any time, and quickly be informed how to handle the stream.

Just to keep spewing on ... The PCR is used by the Decoder, and referenced bye the Video and Audio Packet data so that the Decoder can know exactly when to send frame data to the ES decoders in order to keep the Stream syncronized with the source and the Video synced with the Audio. This information is also used when the Video GOP Structure includes B Frames.


Cheesy ASCII example:

PAT------->\
PMT------->\\
PCR------->>>>>> TS Packet (188 bytes) >>>
VIDEO---->//
AUDIO---->/

Each of the incoming data sources are multiplexed into the data payload section of the TS Packet structure which is sent across the network in 7 TS packets per UDP payload. This value is nice because it is the largest number of whole TS packets that can fit under the Ethernet MTU of 1500 bytes. In fact since it is only 1316 bytes (7 * 188) there is still plenty of room left over for additional header data such as RTP encapsulation and possible Encryption and Tunneling.


hope this is helpful, and there is pleny of in depth detail available on the web, just search under TS Packet Structure and MPEG2...

-vsipat

M.Shimoda

Postby M.Shimoda » 12 Nov 2004 20:25

OK, thanks a lot for helping, but I have one more question...
What's the difference of choosing MPEG-TS or MPEG-1 for output streaming in VLC?

Guest

Postby Guest » 05 May 2006 08:33

vsipat,

Now that's a short and brief ontrouction to what a transport stream really is. This information will be a great start and intro for beginners.


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 8 guests