How Player gets Stream from HLS Server?

http live streaming playlist relationship

When a player request for the stream from the server, it sends a playlist/manifest (master playlist) file which contains the details of all the streams. Master Playlist also contains the information of sub-playlists/streams that are encoded in different bitrates and resolutions. When you open this playlist (.m3u8) files in a text editor, you will be able to see all the details. Below are the samples which will give you a complete picture of these playlists.

Master Playlist

#EXTM3U

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=800000,RESOLUTION=624×352 624x352_800.m3u8

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2600000,RESOLUTION=1280×720 1280x720_2600.m3u8

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1200000,RESOLUTION=640×360 640x360_1200.m3u8

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=450000,RESOLUTION=448×252 448x252_450.m3u8

Master Playlist provide the address for individual playlists/streams. In this master playlist, you can see, there are four streams present which are encoded at different bitrates/bandwidth and resolutions. Here denotes,

  1. EXTM3U: Extended M3U File/Playlist
  2. EXT-X-STREAM-INF: Indicates that the next URL in the playlist file identifies another playlist file.
  3. PROGRAM-ID: Indicates value is a decimal integer that uniquely identifies a particular presentation
  4. BANDWIDTH: Indicates the value is a decimal integer of bits per second (bitrate the video is encoded)
  5. RESOLUTION: Indicates the resolution of the video

Sub Playlist

When a player chooses a playlist by deciding the available bandwidth, it gets the sub playlist which contains the details of the streams. Below is an example of such sub playlist.

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10, no desc
fileSequence0.ts
#EXTINF:10, no desc
fileSequence1.ts
#EXTINF:10, no desc
fileSequence2.ts
#EXTINF:10, no desc
fileSequence3.ts
#EXTINF:10, no desc
fileSequence4.ts
#EXTINF:10, no desc
fileSequence5.ts
#EXTINF:10, no desc
fileSequence6.ts
#EXTINF:10, no desc
fileSequence7.ts
#EXTINF:10, no desc
fileSequence8.ts
#EXTINF:10, no desc
fileSequence9.ts
#EXTINF:10, no desc
fileSequence10.ts

Playlist Relationship

[image_frame url=”http://rcvacademy.com/wp-content/uploads/2016/10/http-live-streaming-playlist-relationship.png” border_style=”boxed-frame” action=”open-lightbox”]