VLC Media Player

VLC is a project developed by VideoLAN project, which started in 1996 at the earliest. It is a fully cross-platform player, suitable for Windows, Mac OS, Linux, Android, iOS and other systems. Currently, there are few fully cross-platform players, and VLC is the most popular one. With 1.3 billion downloads, it is a truly global player.

The overall framework of VLC is designed as a set of module management mechanism, which classifies and abstracts functions into modules. VLC main: Main of player. Initialize libVLC and load the user interface. LibVLCcore: the core of libvlc, abstracting a libvlc_instance_t object that provides a loading/unloading mechanism for modules. Modules: Modules provide specific functions, such as Access, Demux, and decode, in the form of a module. External libraries: External open source libraries.

The following is the process of stringing modules in VLC:

Advantages:

1. Cross-platform, good compatibility;

2. Comprehensive functions, support RTSP, RTMP, FTP, HTTP, HTTPS and other protocols;

3. The code is completely decoupled, modules are independent of each other, and it is convenient to introduce new modules;

4. Strong maintenance team with frequent updates;

Disadvantages:

1. The package compiled by Android platform is large, about 16M;

IjkPlayer

IjkPlayer is an open source project maintained by BiliBili Company. It is a player software developed based on FFMPEG. Currently, it supports both Android and iOS platforms. So it makes sense that IJkPlayer uses FFMPEG as the basis for audio and video players; Ffmpeg provides ffPlay and SDL(Simple DirectMedia Layer) function module, is ffMPEG video playback integration; The entire iJKPlayer is based on ffPlay;IjkPlayer architecture with FFplay as the core, FFplay based on FFmpeg, FFmpeg has a strong scalability, so IjkPlayer expansion ability is mainly FFmpeg expansion ability;

IjkPlayer’s overall process is clear; The main process is as follows:Advantages:

1. The structure of IJKPlayer is relatively simple, and it is basically developed with FFPlay, so it is less difficult to develop;

2. Ijkplayer package is a little smaller than VLC, which is about 4.2m after cutting.

Disadvantages:

1. Ijkplayer has poor scalability, and basically no modules are provided for secondary development of developers;

2. Ijkplayer official maintenance effort is small, version update is slow;

ExoPlayer

ExoPlayer is an open source player launched by Google. It mainly integrates a decoding system provided by Android to parse video and audio. The package of MediaCodec is very perfect, forming a development player with superior performance and good playback stability. Thanks to Google’s promotion, ExoPlayer is very popular at present. ExoPlayer package is light in size and easy to access. Advantages: 1. The access packet is small and 1.1m. 2. Strong maintenance team and fast update speed; Disadvantages: 1. Not suitable for live broadcast; 2. 2. Video decoding cannot be connected to the soft solution, and the scalability is mediocre; 3. This scenario is suitable for simple projects, and there is no bitstream switch during the playback.


Will ExoPlayer replace MediaPlayer as the default player on Android? No, for two reasons:

  • After Android 5.0, the Android Codec architecture was significantly changed. AwesomePlayer was abandoned and NuPlayer was adopted. ExoPlayer was not too compatible.
  • ExoPlayer is still a small, lightweight player, and if it were to be incorporated into the system, it would require too much tweaking and code too much to be worth the cost.

Comprehensive analysis of

For the Android team in terms of player selection, I personally recommend iJkPlayer for the following reasons: 1. Ijkplayer is based on FFMPEG, which has a very good soft solution effect and can support all protocols; 2. 2. Ijkplayer can solve the problem of splashy screen caused by switching bit streams during live streaming; 3. Ijkplayer code is relatively simple and quick to start;

Why not VLC? 1. In order to be compatible with all platforms, some VLC libraries are not selected in a reasonable way, resulting in a large package for Android platform; 2. Although VLC code is highly decoupled, it uses many uncommon libraries and costs a lot to learn;

Why does switching code streams during live streaming cause splashy screens? Here I will briefly explain that ExoPlayer mainly adopts hard decoding and part of the soft decoding provided by the system, and the soft decoding is very limited. As we know, hard decoding works through the GPU, providing corresponding GPU instructions to operate the GPU to achieve the decoding function. When we initialize the player, we initialize MediaCodec according to the current video format, and then the underlying OMX calls the corresponding GPU instruction to work. If there is a request to switch the stream during the live broadcast, a new Instance of MediaCodec will be initialized for ExoPlayer. This will trigger the GPU to regenerate a Dev node. This process will not be smooth and there will be a splintered screen. Soft decoding works by CPU. We feed the operation matrix into CPU for calculation and get the corresponding original data. In this process, only calculation is included, and the underlying dev node does not need to be operated, and the overall execution is not interrupted. So there will be no splashes;

A few suggestions about the player:

1. If the known playback scene is simple, such as small video scene, which is in MP4 (H264 / AAC format), you are strongly advised to use ExoPlayer.

2. It is recommended to introduce software in the form of multiple video interactive forms, such as live broadcast and long video, etc.;

3. If The Android platform does not mind the package size, it is recommended to use VLC, VLC updates frequently, official maintenance is quite powerful; If you are concerned about package size, you are advised to choose iJkPlayer. The current disadvantage of iJkPlayer is that it is not maintained so often.

4. In the long run, many domestic players start from iJkPlayer, gradually evolve, remove the code that is not suitable for their products, introduce the modules they need, and gradually become their own players;

Look at the following seven cattle player evolution road: V1.1.0 version:V1.2.0 version:Use it, absorb internal work, update iteration, bring forth the new