VIDEO DISTRIBUTION AND STREAMING
This chapter main discuss adaptive video streaming, HLS and MSS.
In HLS, there are two types playlist: super and dynamic
- For the dynamic playlist file,
- the #EXT-X-MEDIA-SEQUENCE tag identifies the sequence number of the first chunk, 101.ts. It is used to align chunks from different quality levels.
- The #EXT-X-TARGETDURATION:2 tag indicates the expected duration of the chunks.
- The #EXT-X-KEY:METHOD=NONE tag shows that no encryption was used in this sequence of chunks.
- The #EXTINF:2 tags indicate the duration of each chunk.
- On-demand playlists are distinguished from live playlists by the #EXT-X-PLAYLIST-TYPE and #EXT-X-ENDLIST tags.
Not like HLS using ts format,MMS use mp4 file. MSS employs the MPEG-4 Part 14 (MP4) container and stores each chunk as an MP4 movie fragment within a single contiguous MP4 file for each quality level. Hence, an MSS video is recorded in full length as a single MP4 file (one file per quality level) but is streamed to the client as an ordered sequence of fragmented MP4 file chunks.
The chunks are forwarded by an encoder to a Microsoft IIS server, which aggregates them for each quality profile into an “ismv” file for video and an “isma” file for audio. The “ismv” file contains the complete video with the chunks. Each “ismv” file corresponds to a video encoded at a specific quality level. If a video is encoded with different rates, several “ismv” files are produced. Unlike the Apple fragmenter, playback of each chunk is not possible because the chunks are embedded within the “ismv” file. However, the complete “ismv” video can be played back using the Windows Media player. An aggregate file format is used to store all the chunks and extract them when a specific request is made. For instance, the “ism” file specifies the bit rate of the “ismv” file. The “ismc” file contains the number of chunks and the chunk duration is controlled by the key frame interval, which can vary from 1 to 100s. Unlike MPEG-2 TS, the audio and video information can be transported as separate chunks if desired and then combined by the player.
The file starts with file-level metadata (“moov”) that describes the overall video and the bulk of the payload is contained in fragment boxes that carry fragment-level metadata (“moof”) and media data (“mdat”). The file is terminated with an index box (“mfra”) that allows easy and accurate seeking within the video. The IIS server also creates an XML manifest file that contains information about the available quality levels. The HLS playlist specifies URLs. However, the MSS manifest file contains information that allows the client to create a URL request based on timing information in the stream (Figure 8.39). For on-demand service, the manifest files contain timing and sequence information for all the chunks in the video. Because metadata is provided in every chunk (the current chunk holds timestamps of the next chunk or two), this allows the client to access subsequent chunks without a refreshed manifest file. Hence, the manifest file need not be updated frequently. This is in contrast to HLS where, as new chunks become available, the playlist is updated to reflect the latest available chunks.
HLS vs MMS
Table 8.22 HLS and MSS 802.11n Streaming
MSS | HLS | |
Player startup delay | 1–2s (independent of number of quality levels) | 8–10s for one quality level, 1–2s for eight quality levels |
Video data buffering | About 30s | Rate dependent (more buffering for higher rate) |
Number of quality levels | More levels reduce player stalling but increase delay in quality switch | More levels reduce player stalling but increase delay in quality switch |
Chunk rate slowdown | One chunk every few seconds | One chunk every few seconds |
Duplicate chunk(s) on video quality switch | None | One or more chunks |
Playlist or manifest file | Requested at start of streaming | Requested periodically |
ADOBE HTTP DYNAMIC STREAMING
In addition to the play command, RTMP incorporates a play2 command that can switch to a different rate bitstream without changing the timeline of the content played (Figure 8.62). This is useful for implementing random access and trick modes.
MPEG-DASH
It supports on-demand, live, and time-shifted applications and ads can be inserted between segments. It specifies use of either fragmented MP4 or MPEG-2 TS chunks. The media presentation description (MPD) is an XML manifest that is repeatedly downloaded. It is a key element of the standard and describes the accessible segments and corresponding timing. This enables quality or bitstream switching where video segments or chunks from different representations can be aligned and combined to a single conforming bitstream.