FFmpeg user manual-compilation and installation of FFmpeg
FFMpeg provides compiled executable files on the official website. Many people use FFmpeg, because FFmpeg is open-source and can be DIY and powerful, another advantage of FFmpeg is open source. When using Linux, whether it is ubuntu or redhat, if you use the source provided by the system to install ffmpeg, you will find that the version is relatively old, for example, after apt-get install ffmpeg or yum install ffmpeg, you will find that the version is very old and some new functions are not necessarily supported, such as some new encapsulation formats or communication protocols. Therefore, compilation of FFmpeg is crucial, and it is even easier for you to build your own DIY skills.
2.1 FFmpeg Windows platform Compilation
FFmpeg uses cygwin for compilation on the Windows platform. You must first install the cygwin environment before compiling. If you do not want to use cygwin but use Visual Studio, it takes a lot of time to support the Visual Studio platform. Instead of using the time to do these tasks, it is better to directly use cygwin for support.
The cygwin platform is used to simulate the Linux environment, so compiling FFmpeg on the cygwin platform is equally simple and convenient.
After Configure, you can use make; make install to install the ffmpeg compiled by source code. It is a long process to compile ffmpeg on the cygwin platform. After compilation and installation, you can use the ffmpeg command. However, the compiled ffmpeg is only the simplest ffmpeg and does not support h2664, h265, and Subtitle encoding, if more modules and parameters are supported, more detailed customization is required.
2.2 FFmpeg Linux platform Compilation
FFmpeg has been included in many Linux Release versions. For example, the Ubuntu/Fedora image source contains the installation package, but the version is relatively old. Some do not even support H264 and H265 encoding, or the rtmp protocol is not supported. To support these protocols and encoding, You need to manually compile a set of FFmpeg files. Therefore, in Linux, the best recommended FFmpeg is the FFmpeg customized according to your own needs. By default, when compiling FFmpeg, you need to use the yasm assembler to compile the Assembly part of FFmpeg. If you do not need to compile some code, you can choose not to install the yasm assembler. When the configuration is executed by default, an error is prompted:
According to the error message in the figure, -- disable-yasm can be used for ffmpeg compilation configuration. However, in this case, the compilation code of ffmpeg will not be compiled, and the related optimization will be less. If you need to remove these errors, you can install the yasm compiler to solve them:
After downloading the yasm Assembler and configure, you can use make to compile and make install the compiler;
Then go back to the ffmpeg source code directory and perform the configure operation.
2.3 FFmpeg OSX platform Compilation
Some people use FFmpeg in OSX for coding, transcoding, streaming media collection, etc. To facilitate debugging, they need to generate FFmpeg related to the osx platform. Before compiling FFmpeg under OSX, first, install the compilation environment. The compilation tool chain used in OSX is LLVM,
You also need to install the yasm compilation tool. Otherwise, the yasm tool is not installed when the Makefile is generated.
Install FFmpeg in the LLVM source code, which is the same as several other platforms, especially Linux. FFmpeg is cloned from git: // source.ffmpeg.org/ffmpeg.git:
After the source code is down, you can start to enter the compilation phase and complete the basic compilation work through the following parts:
Then you only need to execute make compilation and make install installation.