VS2012 How to compile FFmpeg has already been mentioned before, originally mainly about how to reference the external library libx264,librtmp,
The FFmpeg version is 3.0.2.
1. Download the x264 source file and compile it
The source address is http://www.videolan.org/developers/x264.html. The libx264 configuration and compile commands are as follows:
./configure--enable-shared--EXTRA-LDFLAGS=-WL,--output-def=libx264.def
Make
Make install
The generated DEF file can be converted to a libx264.lib file via the VC's own Lib.exe command, which is:
Lib/def:yourdll.def/machine:i386/out:yourdll.lib
Note:/def must be added, otherwise the execution command will be faulted. The lib.exe path is C:\Program Files (x86) \microsoft Visual Studio 11.0\vc\lib.
2. Download the compilation librtmp
LIBRTMP relies on open source libraries such as OpenSSL, someone has already built the vs2012 version of the project can be directly used. The main note needs to modify the configuration, otherwise the compilation Ffmeg error.
The configuration that needs to be modified is as follows:
Figure 1 Librtmp configuration options
3. Modify the FFmpeg configure file:
Will
#enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h rtmp_socket
Replaced by
Enabled librtmp && require librtmp librtmp/rtmp.h rtmp_socket-lrtmp-lws2_32-luser32-lgdi32-lwinmm
4. Configuring, Compiling, installing
./configure--toolchain=msvc--enable-shared--ENABLE-GPL--enable-libx264
--enable-encoder=libx264--extra-cflags="-i/home/wgg/libx264/include"
--extra-ldflags="-l/home/wgg/libx264/lib "--prefix="/home/wgg/ out-3.0.2-x264"makemake Install
The corresponding PDB file is generated when the compilation is successful.
If there is a problem to communicate, please dabigatran streaming media/ffmpeg/audio and video 127903734, the group has a compiled library file.
vs2012 MinGW compilation Ffmeg referencing external libraries libx264,librtmp