Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is flv and MP4 video playback?

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Today, I will talk to you about what is flv and MP4 video playback. Many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

What we usually call "video format" actually consists of three parts: video coding, audio coding, and container format. The concept of "coding" actually includes two aspects: coding and decoding. "Video coding", as a verb, refers to the process of converting dynamic image information into binary data; the inverse process is called "video decoding". As a noun, "video coding" usually refers to a specific coding method. The same concept applies to "audio coding", except that it transforms sound information. Most "video files" contain both video and audio, so there are at least two sets of binary data after encoding, and the two sets of data must be synchronized in a certain way, otherwise the pictures we see and the sounds we hear will not match. In order to solve the problem of storage and transmission of many groups of different types of data after coding, they need to be organized according to certain rules, which is called "container format".

Our common video file extensions include .avi, .rmvb, .mp4, .mkv and so on. In fact, the extension refers to some kind of container format. The data stored in these containers may be encoded in many different ways. For example, common avi files usually store xvid or divx-encoded video and mp3-encoded audio. Rmvb files usually store RV40-encoded video and cook-encoded audio. Mp4 files usually store H.264-encoded video and AAC-encoded audio. What is stored in the mkv file may contain the previous ones.

At present, the mainstream package in the industry is MP4. Because MP4 has good features and is friendly to HTML5. The new mp4 specification actually supports seamless splicing, a real streaming media wrapper. Encapsulation formats generally correspond to many coding formats. At present, the mainstream H264 encoder is open source x264, which perfectly balances various factors.

In fact, flv is also a streaming file, which is simpler than other formats, but apple also does not support it. Android ice cream has also natively supported hls. Moreover, stream encryption can be easily realized by using ts slicing. However, HLS has a drawback, that is, Chrome (PC) so far does not support HLS (m3u8) built-in, but Android/iOS browsers support m3u8.

Both rtmp and rtsp require special servers, such as FMS/red5 for rtmp, darwin for rtsp, and plain server for hls.

Video surveillance and video calls. It is obviously inappropriate for this kind of streaming media to use HLS, which is generally supported by HTTP progressive streaming,Android in 4. 0. Containers that can support HPS must be streaming. For example, FLV, MKV and Android will support WEM (that is, MKV) containers with VP8 video format. Therefore, another way to choose streaming media transmission is HPS.

Many domestic video websites support automatic switching, such as traditional flv playback on ordinary PC browsers, m3u8 on Android/iOS, and mp4 on Chrome (PC/Android). The method is to provide multiple source in video.

HTTP Live Streaming technology, which is also supported by the new version of Adobe's Flash streaming server. There is a huge advantage: adaptive rate streaming (adaptive streaming). The effect is that the client will automatically select video streams with different bitrates according to the network conditions, use high bitrates when conditions permit, use low bitrates when the network is busy, and automatically switch between the two at will. This is very helpful to ensure smooth playback in the case of unstable network conditions of mobile devices. The realization method is that the server provides a multi-bitrate video stream, and indicates in the list file that the player automatically adjusts according to the playback progress and download speed.

The feature is that the streaming media is divided into several TS fragments (for example, every 10 seconds), and then these TS fragments are collected for the client player to receive through an extended M3U list file. Once the slicing is completed, the subsequent distribution process does not need to use any additional special software, ordinary network servers can, greatly reduce the configuration requirements of CDN edge servers, and can use any ready-made CDN. The protocol used for distribution is the most common HTTP, and the cache optimization of this protocol by proxy servers is quite mature, while there are few proxy servers to optimize the cache of RTSP. This has a considerable advantage in playing (soft) real-time video because this distribution puts much less load on the source server. The same benefit exists: if you want to jump in an hour-long video, if you use a single video file in MP4 format and also use the HTTP protocol, then the proxy server needs to support HTTP range request to get some of the large files. Not all proxy servers have good support for this. On the other hand, HTTP Live Streaming only needs to find out the corresponding TS fragments according to the timeline in the list file to download. There is no need for range request, and the requirements for proxy servers are much smaller. All proxy servers support efficient caching of small files.

Solution:

Uniformly use the mainstream H264 encoder.

1. For uploaded videos, ffmepg is used to detect the encoding, for example, MP4 coding is converted to H264. The web end plays the transcoded flv\ mp4. Install the flv\ mp4 extension through the nginx agent. The Flv Stream module in nginx can realize the function of flv streaming media and support flv video progress bar dragging. The function of installing yadmi,yadmi is to add keyframes to flv files to realize drag and play. In addition, nignx can also act as a proxy server to proxy the back-end RTMP/RTMP streaming media server based on Flash Media Server or Red5

2. Flv\ mp4 after transcoding, generate TS fragments, extended M3U list file, and support android client and IOS client.

3. Android/iOS browsers support m3u8 as well as standard mp4.

After watching the above content, do you have any further understanding of flv and MP4 video playback? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report