1 Introduction
FFmpeg is a record that can be used, converting the digital audio, video, and can open it into a computer program stream. Under the LGPL or GPL license. It provides a record, convert and stream audio and complete solution for video. It contains a very advanced audio / video codec library libavcodec, in order to ensure high portability and codec quality, libavcodec in a lot of code developed from scratch.
FFmpeg in the Linux platform, but it also can be compiled to run other operating system environments, including Windows, Mac OS X and so on. The project was first initiated by Fabrice Bellard, between 2004 and 2015 by the Michael Niedermayer is responsible for maintenance. Many FFmpeg developers are from the MPlayer project, and FFmpeg is currently on the server MPlayer project team. The name of the item from the MPEG video coding standard , the front of "FF" representative of "Fast Forward".
ffmpeg
The official website address is: https://www.ffmpeg.org/ffmpeg
Github project's address is: https://github.com/FFmpeg/FFmpeg
2. Composition
There are three main constituting FFmpeg,
2.1 the first portion is different from the role of four tools, namely: ffmpeg.exe, ffplay.exe, ffserver.exe and ffprobe.exe.
- ffmpeg.exe: audio and video transcoder, converter
- ffplay.exe: simple audio and video player
- ffserver.exe: streaming media server
- ffprobe.exe: simple multimedia stream analyzer
2.2 The second part is for developers to use the SDK, libraries compiled for the various platforms. If the above four tools are complete finished product in the form of toys, these libraries is equivalent to Lego, we can use these libraries to develop their own applications according to their needs. These libraries are:
- libavcodec: comprising a video encoder and audio decoder
- libavutil: The simplified programming tool contains multimedia applications, such as a random number generator, data structures, functions and other mathematical functions
- libavformat: package comprising a plurality of multimedia container format, tools decapsulation
- libavfilter: contains conventional multimedia processing filter function
- libavdevice: apparatus for audio and video data capture and rendering functions associated
- libswscale: an image scaling, and color space and pixel format conversion function
- libswresample: resampling, and audio format conversion functions
2.3 The third part is the source code for the entire project, whether it is compiled executable program or SDK, is compiled from the source code out. FFmpeg source code from the implementation of the C language, the major development on the Linux platform . FFmpeg is not an isolated project, there is also more dependent on third-party engineering to enhance its own capabilities. In the current series of blog / video, we do not involve too much source code related content, to call the main FFmpeg tools and SDK based.
3. Download & install (Windows version)
- Download compiled Windows version: http://ffmpeg.zeranoe.com/builds/
- FFmpeg is divided into three
Static
versions:Shared
, ,Dev
- The first two versions can be used directly from the command line. Consists of three
exe
:ffmpeg.exe
,ffplay.exe
,ffprobe.exe
Static
Versions ofexe
larger, because it is related toDll
have been compiled into theexe
inside.Shared
Versionexe
volume is relatively much smaller, because when they also need to run the relevant dll call the appropriate functionDev
Version for developers, which contains librariesxxx.lib
and header filesxxx.h
The static version downloaded, extract to C: \ ffmpeg
Add the environment variable (win10): Right My Computer -> Properties - "Advanced System Settings -" Environment Variables, add the path C: \ ffmpeg \ bin
In the command line window enter ffmpeg -version command, proved successful installation
4. Use the command line
4.1ffmpeg.exe
Transcoding application for:
A simple command input.avi transcoding transcoded into output.ts, and set the video bit rate is 640kbps
ffmpeg -i input.avi -b:v 640k output.ts
Specific usage Reference: https://blog.csdn.net/leixiaohua1020/article/details/12751349
detailed instructions (in English): http://ffmpeg.org/ffmpeg.html
4.2 ffplay.exe
The main application for playing
Play test.avi
ffplay test.avi
Specific reference may be use: https://blog.csdn.net/leixiaohua1020/article/details/15186441
detailed instructions (in English): http://ffmpeg.org/ffplay.html
4.3 ffprobe.exe
ffprobe is an application for viewing file formats.
Detailed instructions for use (English): http://ffmpeg.org/ffprobe.html
5. References
- https://www.jianshu.com/p/7ed3be01228b
- https://blog.csdn.net/leixiaohua1020/article/details/15811977
- https://blog.51cto.com/yuanhuan/1246370
- http://ffmpeg.org/documentation.html
- https://zh.wikihow.com/%E5%9C%A8Windows%E4%B8%8A%E5%AE%89%E8%A3%85FFmpeg%E7%A8%8B%E5%BA%8F