Metadata is carried in MPEG-2 transport streams as described in section 2.12 of reference . HTTP Live Streaming metadata is carried in an elementary stream (PES) instead of, for example, in a carousel. The metadata stream must be in the same program as the main program material (i.e. the audio/video content).
ID3 metadata is self-describing and needs no configuration information, so the provisions for metadata decoder configuration data are not used.
The remainder of section 2 of this specification describes the details of the syntax and field values from section 2 of reference  for ID3 format metadata used with HTTP Live Streaming.
In the syntax tables in section 2.3.2 of this specification, the syntax structure (left column) is shown with only the names of fields and the part of the outline that is in effect for ID3 metadata as described in this specification. Conditional blocks for which a condition is false are omitted. The right column in the syntax tables indicates the value needed for each field in this context, or contains an explanation of that field.
The MPEG-2 specification  should be consulted for the complete syntax, field sizes, and acceptable values.
2.2 Summary of the Code Points Used
ID3 defines both a format and a semantic, and so the same registered
format_identifier is used for both
The registered value for these, at the registration authority (reference ), is the four-character string
‘ID3 ’ (the characters
I D 3 space, or
0x49 0x44 0x33 0x20).
To indicate that a registered value is used, the
metadata_application_format fields take the values
The ID3 metadata is carried in a private stream, not a stream formatted as metadata Access Units (MAUs) as defined in 12.4 of . The
stream_id value used for the stream is therefore
0xbd, as specified in 2.12.3 of . The
stream_type is set to
0x15, indicating carriage of metadata in a PES stream, as specified in 22.214.171.124 of .
Since only one metadata stream is normally carried, the
metadata_service_id is normally set to
0; however, any suitable value can be used to distinguish this metadata stream from other metadata streams, if present.
2.3 Descriptors Used
The format and content of the metadata descriptors is documented in sections 2.6.58 to 2.6.61 of .
2.3.2 Descriptor Loop of the PMT for the Program
To declare the presence of the metadata stream, a
metadata_pointer_descriptor (2.6.58 of ) is placed in the PMT, in the
program_info loop for the program. The metadata must be in the same program as the main program (audio/video) content; the use of this descriptor to refer to another program is not supported.
The elementary stream carrying the metadata needs to be declared in the loop of elementary streams, in the program map (section 126.96.36.199 of ):
2.3.3 Descriptor Loop of the PMT for the Elementary Stream
To declare the format of the metadata stream, a
metadata_descriptor (2.6.60 of ) is placed in the PMT, in the
es_info loop for the elementary stream.
2.4 PES Stream Format
ID3 metadata is stored as a complete ID3v4 frame in a PES packet, including a complete ID3 header.
The ID3 tag must start immediately after the PES header; this PES header must contain a PTS (
PTS_DTS_flags set to
'10'). The PTS must be on the same timeline as the audio and video frames. The
data_alignment bit must be set to
1. The PES header must contain a
PES_packet_length that is non-zero.
If an ID3 tag is longer than 65535 bytes, it must have more than one PES header. The second and following PES headers must have
data_alignment set to
0, and should have the
PTS_DTS_flags set to
‘00’ (and hence no PTS).
The PES header is formatted as documented in 188.8.131.52 of .
The metadata stream is incorporated into a transport stream in the same way as audio or video is. For example, in a
transport_packet() (see 184.108.40.206 of ) the
payload_unit_start_indicator is set to
1 only when a PES header follows. (The PES header, in turn, indicates whether the start of the ID3 data follows, or whether that has been divided into multiple PES packets).