In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
After the CDN of Aliyun is activated, video files are usually stored on OSS for video service. Slicing service is used at this time. M3u8 is a common media format. M3U8 is the Unicode version of M3U, encoded in UTF-8. "M3U" and "M3U8" files are the basis of the HTTP Live Streaming (HLS) protocol format used by Apple.
This protocol format can be played on devices such as iPhone and Macbook.
M3u8 files are actually part of the HTTP Live Streaming (abbreviated to HLS) protocol, while HLS is a HTTP-based streaming media network transmission protocol proposed by Apple. HLS works by dividing the whole stream into small HTTP-based files to download, only a few at a time. When the media stream is playing, the client can choose to download the same resource at different rates from many different alternate sources, allowing streaming sessions to adapt to different data rates. When starting a streaming session, the client downloads an extended M3U (m3u8) playlist file containing meta-data to find available media streams. HLS requests only basic HTTP messages, and unlike Real-time Transport Protocol (RTP), HLS can pass through any firewall or proxy server that allows HTTP data to pass through. It is also easy to use content distribution networks to transmit media streams.
HLS is a new generation streaming media transmission protocol. Its basic implementation principle is to slice a large media file and record the resource path of the sliced file in the m3u8 file (that is, playlist). Some additional descriptions (such as multi-bandwidth information of the resource) are provided to the client. According to the m3u8 file, the client can obtain the corresponding media resources and play them.
Therefore, the client obtains the HLS stream file mainly to parse the m3u8 file.
Introduction to M3U8 Fil
The m3u8 file is essentially a playlist (playlist), which may be a media playlist (Media Playlist) or a main list (Master Playlist). But no matter what kind of playlist it is, the internal text is encoded in utf-8.
When a m3u8 file is used as a media playlist (Meida Playlist), its internal information records a series of media fragment resources, which can be played sequentially to fully display multimedia resources. The format is as follows:
# EXTM3U
# EXT-X-TARGETDURATION:10
# EXTINF:9.009
Http://media.example.com/first.ts
# EXTINF:9.009
Http://media.example.com/second.ts
# EXTINF:3.003
Http://media.example.com/third.ts
For VOD, the client only needs to download the above clips in order and play them in turn. For LVB, the client needs to regularly re-request the m3u8 file to see if there are any new fragments of data that need to be downloaded and played.
When m3u8 is the main playlist (Master Playlist), it provides multiple stream list resources (Variant Stream) of the same media resource internally. The format is as follows:
# EXTM3U
# EXT-X-STREAM-INF:BANDWIDTH=150000,RESOLUTION=416x234,CODECS= "avc1.42e00a,mp4a.40.2"
Http://example.com/low/index.m3u8
# EXT-X-STREAM-INF:BANDWIDTH=240000,RESOLUTION=416x234,CODECS= "avc1.42e00a,mp4a.40.2"
Http://example.com/lo_mid/index.m3u8
# EXT-X-STREAM-INF:BANDWIDTH=440000,RESOLUTION=416x234,CODECS= "avc1.42e00a,mp4a.40.2"
Http://example.com/hi_mid/index.m3u8
# EXT-X-STREAM-INF:BANDWIDTH=640000,RESOLUTION=640x360,CODECS= "avc1.42e00a,mp4a.40.2"
Http://example.com/high/index.m3u8
# EXT-X-STREAM-INF:BANDWIDTH=64000,CODECS= "mp4a.40.5"
Http://example.com/audio/index.m3u8
The alternate streaming resource specifies a variety of media playlists with different bitrates and formats, and the alternate streaming resource can also provide different versions of resource content at the same time, such as audio files in different languages, video files shot from different angles, and so on. Customers can select the resources of the appropriate code stream according to different network states, and it is best to select the appropriate resource content according to the preferences of users.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.