This article mainly introduces FFmpeg, the article comes from the blog Garden Rtc.blacker, supports the original, the reprint must explain the source, the individual public number blacker, more see Www.rtc.help
Description
PS1: If you start learning audio and video directly from WEBRTC, you may not have heard of ffmpeg, and you don't need it, but as you improve your personal abilities, you'll find it really useful.
As far as I am currently exposed to the audio and video enterprises, have not encountered the use of ffmpeg (video manufacturers will upload video files for users to do transcoding, because their clients in the playback of the time needed to adapt to different client network bandwidth for different resolutions, or to do some custom development), this shows its strong.
PS2: Introduction ffmpeg article Many, many are written very detailed, so I do not need to introduce from beginning to end, this article is mainly integrated official website and predecessors of the results (at the bottom of the article source), and then add some straightforward explanation, so that everyone can better understand.
The following begins the FFmpeg learning Journey:
1, many people do not know how to read "FFmpeg". It reads "EF EF em Peg"
What is the role of 2,ffmpeg?
Answer: The video file encoding, transcoding, playback, editing, plus subtitles can be used to ffmpeg, the following is a detailed explanation of the official website:
2.1, "FFmpeg is the leading multimedia framework, able to decode, encode, transcode, MUX, Demux, stream, filter and play PR Etty much anything that humans and machines has created ".
2.2,a Complete, Cross-platform solution to record, convert and stream audio and video
3, where to use the ffmpeg?
Answer: Almost the mainstream multimedia play frame is used in ffmpeg, such as Mplayer,ffplay, shooter player, Storm video, Kmplayer,qq av ...
Here is the process for FFmpeg to play multimedia files:
3.1. Multiplexing (DEMUX)
when we open a multimedia file, the first step is to re-use it, called Demux. Why do you need this step, what exactly is this step?
We know that in a multimedia file, including both audio and video, and audio and video are compressed separately, because the audio and video compression algorithm is not the same, since the compression algorithm is not the same, then certainly the decoding is not the same, so you need to first decode the audio and video respectively.
Although audio and video are compressed separately, the compressed audio and video are bundled together for the convenience of the transfer process.
So the first step in decoding is to separate the audio and video streams that are tied together, the legendary de-multiplexing.
So in a word, de-multiplexing this step is to separate the audio stream and video stream bundled together in the file to facilitate decoding them separately, the following is the effect after Demux.
3.2. Decoding (Decode)
Needless to say, a multimedia file must be compressed in one or several formats, often referred to as video and audio coding.
coding is to reduce the amount of data, otherwise it will be a big challenge to our storage devices and network bandwidth . so we have to compress the media information as much as possible.
3.3. API functions for the decoding process in FFmpeg
Understand the above a media file from open to decoding process, it is easy to read the FFmpeg code, FFMPEG framework is basically follow this process, but not each process corresponding to an API, Here is a diagram of my analysis ffmpeg and according to my understanding of the FFmpeg decoding process corresponding API, I think this picture should be to understand ffmpeg and codec have some help.
FFmpeg Demux This step is done through the Avformat_open_input () This API, the API reads the header information of the file, and does Demux, after which we can read the audio and video streams in the media file, and then through the Av_read_ FRAME () reads out the basic data stream packet from the audio and video stream, then decodes the packet to Avcodec_decode_video2 () and the corresponding API.
4, more FFMEPG information reference:
4.1,http://blog.csdn.net/leixiaohua1020/article/details/15811977, there is a lot of information on Thor's side, very rich.
4.2,http://blog.chinaunix.net/uid-26611383-id-3976154.html, the above 3rd main reference from three elder brother side.
4.3,http://ffmpeg.org/, official website
Like the series of articles please follow my public number blacker, or scan the QR code below:
Android IOS WebRTC Audio Video Development Summary (49)--FFmpeg introduction