m3u8 Field meaning analysis

Source: Internet
Author: User

m3u8 Field meaning analysis

Hls,http live Streaming is an apple-defined protocol for real-time streaming, and HLS is based on the Http protocol, which consists of two parts: the m3u8 profile and the TS media file.

m3u8 file
The media file is described in text form and consists of a series of tags. Examples are as follows:

For more information on m3u8, please refer to the website:

http://blog.csdn.net/test_1207/article/details/8160863

m3u8 the meaning of the other fields:

#EXTM3U

The first line of each m3u file must be this tag.

#EXTINF:<duration>,<title>

Duration indicates that the duration (seconds) must be an integer if the version above 3 can be a floating-point number.

#EXTINF

Specifies the duration of each media segment (TS), which is valid only for the URI that follows it, separated by this tag for each two media segment URI.

#EXT-x-byterange

Indicates that the media segment is a section of a media URI resource that is valid only for subsequent media URIs in the following format: #EXT-x-byterange:<n>[@o]

where n indicates the size of this interval, the O table is offset in the URI; "The Ext-x-byterange tag appeared in version 4 of the Protocol".

#EXT-x-targetduration

Specifies the maximum media segment length of time (in seconds). So the length of time specified in the #extinf must be less than or equal to the maximum value. This tag can only appear once in the entire playlist file (in the case of nesting, the tag will appear only if the m3u8 has a real ts URL). The format is as follows:

#EXT-x-targetduration:<s>:s represents the maximum number of seconds.

#EXT-x-media-sequence

Each media URI has a unique ordinal number in playlist, adjacent to the ordinal +1.

#EXT-x-media-sequence:<number>

A media URI is not required to be included, and if not, the default is 0.

#EXT-x-key

Indicates how the media segments is decoded. It is scoped to all media URIs that appear before the next tag, in the following format:

#EXT-x-key:<attribute-list>:

NONE or AES-128. If none, then the URI and the IV attribute must not exist, if it is AES-128 (Advanced encryption

Standard), the URI must exist and IV may not exist. For AES-128, the Keytag and URI properties together represent a key file that can be obtained by URI, and if there is no IV (initialization Vector), the serial number is encoded as IV, The high-level of the serial number is assigned to 16 bytes of buffer, the left side is 0, and if there is an IV, the value is treated as a 16-byte 16 binary number.

#EXT-x-program-date-time

Associate an absolute time or date with the first sample in a media segment, valid only for the next Meida URI, in the following format:

#EXT-x-program-date-time:<yyyy-mm-ddthh:mm:ssz>

For example:

#EXT-x-program-date-time:2010-02-19t14:54:23.031+08:00

#EXT-x-allow-cache:

Whether to allow the cache, this can appear anywhere in the playlist file, and at most once, the effect is all media segments. The format is as follows:

#EXT-x-allow-cache:<yes|no>

#EXT-x-playlist-type

Provides information about the variability of the playlist, which is valid for the entire playlist file and is optional, in the following format:

#EXT-x-playlist-type:<event| Vod>: If it is a VOD, the server cannot change the playlist file, or if it is an event,

The server cannot change or delete any part of the playlist file, but you can add a new line to the file.

#EXT-x-endlist

Represents the end of the playlist, which can appear anywhere in the playlist, but only one, in the following format:

#EXT-x-endlist

#EXT-x-media

A version of a language/translation that is used to represent the same content in a playlist, for example, by using 3 of these tags to represent 3 of audio without speech, or using 2 of this tag to represent different angles of video in playlists. This tag is independent and has the following format:

#EXT-x-media:<attribute-list>: This property list contains: URI, TYPE, Group-id, LANGUAGE, NAME, DEFAULT, AutoSelect.

URI: If not, the selectable version of the tag description exists in the Ext-x-stream-inf of the main playlist;

Type:audio and VIDEO;

Group-id: Mediatag with the same ID, forming a set of styles;

Language:identifies The primary LANGUAGE used in the rendition.

Name:the value is a quoted-string containing a human-readable description of the rendition. If the LANGUAGE attribute is present then this description should are in that LANGUAGE.

Default:yes or no, the default is no, and if yes, the client will play this option unless the user chooses to do so.

Autoselect:yes or no, the default is no, and if yes, the client chooses according to the current playback environment (the user does not choose according to his preference).

The Ext-x-media tag appeared in version 4 of the Protocol.

o All Ext-x-media tags in the same group must with the same TYPE

Attribute.

o All Ext-x-media tags in the same group must has different NAME

Attributes.

o A group must not has more than one member with A DEFAULT

attribute of YES.

O All members of a group whose autoselect attribute have a value of

YES must has LANGUAGE [RFC5646] attributes with unique values.

O All members of a group with Type=audio must use the same AUDIO

Sample format.

O All members of a group with Type=video must use the same VIDEO

Sample format.

#EXT-x-stream-inf

Specifies a media URI that contains multimedia information as playlist, which is generally used as a nested m3u8, which is only for the URI immediately following it.

The format is as follows:

#EXT-x-stream-inf:<attribute-list>

<URI>

Has the following properties:

BANDWIDTH: bandwidth, must have.

Program-id: This value is a decimal integer that uniquely identifies a specific description within the scope of the playlist file. A playlist file can be

Can contain multiple of this tag with the same ID.

CODECS: Not required.

RESOLUTION: Resolution.

AUDIO: This value must match the value of the "Group-id" attribute in the "Ext-x-media" tab of the audio category.

VIDEO: Ditto

m3u8 Field meaning analysis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.