m3u8 is UTF-8 encoding format. M3U8 refers to the UTF-8 encoded M3U file, and the M3U file records an index plain text file. When you open it, the playback software does not play it, but finds the network address of the corresponding audio and video file based on its index for online processing. Play. M3U8 is a common streaming media format that mainly exists in the form of a file list. It supports both live broadcast and on-demand playback. It is especially commonly used on platforms such as Android and iOS.
The operating environment of this tutorial: Windows 7 system, Dell G3 computer.
M3U8 Introduction
M3U8 files refer to M3U files in UTF-8 encoding format (M3U uses Latin-1 character set encoding). The M3U file is a plain text file that records the index. When you open it, the playback software does not play it, but finds the network address of the corresponding audio and video file based on its index for online playback. The process is as follows:
m3u8 playback process.png
M3U8 is a common streaming media format that mainly exists in the form of a file list and supports both live broadcast and On-demand, especially on Android, iOS and other platforms, is most commonly used.
Advantages of M3U8
1. It can adapt to multiple code rates. According to the network bandwidth, the client will automatically select a file suitable for its own bit rate for playback to ensure smooth video streaming. The representative is Apple's HLS (HTTP Live Streaming). HLS has a feature: adaptive streaming. The client can automatically select video streams with different bit rates according to network conditions. Use high bit rates when conditions permit, and use low bit rates when the network is busy. And Automatically switch between the two at will. This is very helpful to ensure smooth playback when the network condition of mobile devices is unstable.
2. Reduce the load pressure on the source server. The characteristic of M3U is to divide the streaming media into several TS fragments, and then collect these TS fragments through an extended m3u list file for the client player to receive. The advantage of doing this compared to using the RTSP protocol is that once the segmentation is completed, the subsequent distribution process does not require the use of any additional special software. An ordinary network server can be used, which greatly reduces the configuration requirements of the CDN edge server and can use any off-the-shelf CDN. The most common protocol used for distribution is HTTP. The proxy server's caching optimization for this protocol is quite mature, while few proxy servers have caching optimization for RTSP.
3. For non-real-time videos, the benefits also exist: when playing a single MP4 format video file using the HTTP protocol, the proxy server needs to support HTTP range request to obtain part of the large file, but not all proxies Servers all have good support for this. M3U, on the other hand, only needs to find the corresponding TS fragment to download based on the timeline in the list file. It does not require a range request and has much smaller requirements on the proxy server. All proxy servers support efficient caching of small files.
4. Why use TS instead of MP4? This is because two TS clips can be seamlessly spliced and the player can play them continuously. However, due to the encoding method of MP4 files, two MP4 clips cannot be seamlessly spliced. , the player will continuously play two MP4 files and there will be broken sound and picture interruption, which will affect the user experience.
For more related knowledge, please visit theFAQcolumn!
The above is the detailed content of What format is m3u8?. For more information, please follow other related articles on the PHP Chinese website!