What FFmpeg is?

I began to learn audio and video development, mainly through reading Liu Qi, Zhao Wenjie edited "FFmpeg from entry to the master," summed up their feelings and experiences written entry and Dr. Lei Xiaohua blog.

Official Documentation

FFmpeg official document: https://ffmpeg.org/documentation.html

FFmpeg官方wiki:http://trac.ffmpeg.org/wiki

Chinese classical data

Dr. Lei Xiaohua csdn link: https://blog.csdn.net/leixiaohua1020

ChinaFFmpeg:http://bbs.chinaffmpeg.com

In addition to the above information, you can also get a lot of relevant information through Google, Baidu and other search engines.


This article briefly outline what FFmpeg is?


A, FFmpeg definition

FFmpeg is both an audio and video codec tool, but also a set of audio and video codec development kit, as a codec development kit, which provides a rich audio and video call interface for developers.

FFMpeg provides a variety of media formats encapsulation and decapsulation, comprising a plurality of audio and video coding, various streaming protocols, multiple color format conversion, a variety of sample rate conversion, multiple bit rate conversion; multi the FFmpeg framework abundant species plug-in module, comprising the encapsulation and decapsulation plug, like plug-in encoding and decoding.

FFmpeg in "FF" refers to the "Fast Forward", FFmpeg in "mpeg" is "Moving Picture Experts Group (Moving Picture Experts Group)."

PS: There are a lot of people do not know "FFmpeg" should be how to read. It read as "ef ef em peg".


Two, FFmpeg of the basic building blocks

The basic composition of FFmpeg frame comprises AVFormat, AVCodec, AVFilter, AVDevice, AVUtil other module library. What follows is a general introduction to these modules.

(. 1) the FFmpeg package module AVFormat

AVFormat is implemented in the vast majority of the media package in the field of multimedia formats, including packing and unpacking, such as MP4, FLV, KV, TS and other package file format, RTMP, RTSP, MMS, HLS and other network protocol encapsulation format.  Whether the format FFmpeg supports some media package, the package contains a library of the format depends on compile time. According to the actual needs, can be expanded media package format, increase their customized packaging formats, i.e. increase their encapsulation in AVFormat processing module.

(2) the FFmpeg codec plate AVCodec

AVCodec currently implemented in the field with the most popular multimedia codec formats, supports both encoding, decoding is also supported. AVCodec addition to supporting MPEG4, AAC, MJPEG like carrying media codecs, supports third-party codecs, such as H.264 (AVC) coding, the encoder requires x264; H.265 (HEVC) encoding , requires X265 encoder; MP3 (mp3lame) coding, the encoder requires libmp3lame. If you wish to increase your coding format, or the hardware codec, the corresponding need to increase the encoding and decoding module in AVCodec.

(. 3) the FFmpeg the filter module AVFilter

AVFilter library provides a generic audio, video, subtitles, filter processing framework. In AVFilter, the filter frame may have a plurality of inputs or multiple outputs.

(. 4) the FFmpeg video image conversion calculation module swscale

swscale module provides high-level image converting the API, for example, which allows image scaling and pixel format conversion, common in the scaled image from 720p to 1080p, or 480p or the like, or converted into image data from YUV420P YUYV or turn YUV such as RGB image format conversion.

(. 5) the FFmpeg audio conversion calculation module swresample

swresample module provides a high level of audio resampling API. For example, it allows the operation of the audio samples, the audio channel layout conversion layout adjustment.


Three, FFmpeg main workflow

The main FFmpeg relatively simple process, as follows:

1) decapsulates (demuxing)

2) decoding (Decoding)

3) encoding (Encoding)

4) Package (Muxing)

Wherein the need to go through six steps as follows:

1) Read the input source

2) audio and video decapsulates

3) decoding the audio and video data for each frame

4) each frame of encoded audio and video data

5) re-encapsulation of the audio and video

6) to the target

FFmpeg entire workflow process steps as shown below:


Four, FFmpeg some scenarios

Here are some FFmpeg are used in the where (only a few are listed here as I know, in fact, far more than this). It means to illustrate: FFmpeg is very important.

Use FFmpeg as a kernel video player:

  • Mplayer, ffplay, shooter player, Storm video, KMPlayer, QQ video ...

Use FFmpeg as Directshow Filter kernel:

  • ffdshow,lav filters...

FFmpeg used as core transcoder:

  • ffmpeg, Format Factory ...

In fact, FFmpeg audio and video codecs is really too strong, including almost all existing audio and video coding standards, so as long as doing audio and video development, almost inseparable from it.


reference:

Liu Qi, Zhao Wenjie edited "FFmpeg Mastering" Chapter 1


Guess you like

Origin www.cnblogs.com/linuxAndMcu/p/12039546.html