Three Underlying architectures of Media Player

Source: Internet
Author: User

Since the launch of shooter audio and video, more and more times have been drowned by Code and various bugs-fix. It takes too long to bury yourself in the field and often forgets where you are. So occasionally, we will share some experiences and experiences with you.

Media Playback tools mainly refer to video playback. Due to the huge compatibility and complicated algorithms, there are only a few systems that stand out from the architecture. Generally, there are three major architectures in the industry: PC, mplayer, and vlc. These three architectures and their derivatives occupy 90% of the market, and all the free media playing software that users can see come from these three architectures.

Mcm/HC Architecture
Media Player classic should be tied to its sequencer MPC-HC. Based on the DirectShow architecture, MPC is a player of the ancestor level in windows. This includes the first KMP stream, that is, the Code copied to the MPC, and then the interface. Mpchc, the successor of the original author gabest of the MPC, is gradually withdrawn from development. mpchc has many innovative features, including integration with FFMPEG and support for more DirectX features and dxva.

Advantage: dxva is more directly supported. You can call a third-party filter component for some strange formats on Windows to enjoy better compatibility.
Disadvantages: Some people say that DirectShow is the most difficult SDK for Windows, which is complicated in development. The features that DirectShow allows third-party encapsulation also complicate compatibility and stability issues. It is difficult to analyze and handle third-party filter exceptions, more difficult to reuse;
The architecture of the shooter player mainly comes from the MPC-HC, but more of the advantages of FFMPEG, The DirectShow filter is rewritten in multiple places, which greatly enhances the use of FFMPEG and improves the decoding stability, the decoding capability and compatibility are also extended.

Mplayer Architecture
If the MPC is the ancestor of windows, mplayer is the ancestor of media playing on Linux. Mplayer uses FFMPEG as the decoding core and is also the most closely integrated project with FFMPEG. The FFMPEG code is hosted by mplayer, and the developer group has a very large intersection. With the strength of Linux developers/users, mplayer has established a much more stable workflow than DirectShow. Beyond the functions of FFMPEG itself, we later used reverse engineering to make it possible to call the DirectShow filter DLL on Windows, making the mplayer architecture more attractive and becoming an excellent work with both stability and performance.

Advantages: stable and compatible
Disadvantages: the code structure is not clear; it is difficult to read by pure C language development; more obstacles need to be crossed for video card hardware acceleration

VLC Architecture
VLC is a rising star, and the development speed is amazing. Although it is also based on FFMPEG, it may be relative to the mplayer architecture of "three years left, three years right, three years of sewing and completing three years". At the beginning of the design, the VLC architecture has taken into account modular development, so it is more attractive to young developers. It has become a very fast-growing architecture in recent years.

Advantages: stable and compatible
Disadvantages: pure C language development, difficult to read; hardware acceleration is slightly difficult

Many people will find that the name of FFMPEG can be seen in the three architectures.Speaking of FFMPEG, It's really "One Ring to rule them all, one ring to find them, one ring to bring them all". Someone told me at # FFMPEG that they wanted to write media players without FFMPEG, just like creating a car instead of a wheel. However, FFmpeg is only used as a command line tool or Class Library (such as libavcodec. End users seldom have direct access to FFMPEG, so their popularity is also small. Detailed FFMPEG architecture, which will be resumed next time ......

* Note 1: All advantages and disadvantages are only for the architecture itself
* Note 2: the opinions in this article are personal opinions for your reference only.

From: http://blog.splayer.org/index.php/2010/03/%E5%AA%92%E4%BD%93%E6%92%AD%E6%94%BE%E4%B8%89%E5%A4%A7%E5%BA%95%E5%B1%82%E6%9E%B6%E6%9E%84%E7% AE %80%E6%9E%90/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.