FFmpeg is an open source, free cross-platform video and audio streaming project that provides a complete solution for recording, converting, and streaming audio and video. The author will attempt to use the library to implement a complex network environment,
A streaming media server that supports the standard RTSP protocol. Due to the incompatibility of the C + + compiler provided by Visual Studio with the C99 standard, it cannot be compiled directly using msvc++, this article uses a class that is configured under Windows
Linux-like compilation of the way the environment compiled FFmpeg source code.
1. Preparatory work:
Download the following four software first.
1) Mingw-msys Bundle http://sourceforge.net/projects/mingwbundle/
2) SDL http://www.libsdl.org/download-1.2.php Note: In this environment 2.0.3 version of the source code compilation will be problematic, not recommended.
3) Yasm http://yasm.tortall.net/Download.html
4) FFmpeg http://www.ffmpeg.org/download.html
2. Install Mingw-msys bundle software
Mingw-msys bundle software also contains MinGW and MSYS, do not need to connect to the network for installation, follow the software's default installation Wizard, all the way next, the software installed.
When installed, a shortcut is generated on the desktop, pointing to the file "C:\Program Files\mingw-msys\msys.bat". Double-click to start the console, and all subsequent actions will be completed under this console.
3. Installation of SDL
Unzip the SDL source code into the F:\Work\ffmpeg-2.4\SDL-1.2.15 directory. Go to the SDL directory and execute each
./configure--prefix=/usr/local/sdl
Make
Make install
Complete the installation of SDL.
After the SDL compiles, the generated bin file, include file, and Lib file are stored in the C:\msys\1.0\local\SDL directory.
Import the SDL environment variables using the following command.
Export path= "$PATH:/usr/local/sdl/bin:/usr/local/sdl/include/sdl:/usr/local/lib"
Otherwise, the SDL support item is displayed as no when the FFmpeg configure is executed. (Note: The MinGW default root directory corresponds to the C:\msys\1.0\ directory under Windows and can be viewed through the echo $PATH)
4, Installation Yasm
The Yasm source package (in the YASM official website downloaded a long time to download, each download to half of the broken, and later in csdn downloaded) extracted to the F:\Work\ffmpeg-2.4\yasm1.2.0 directory.
Go to the Yasm directory and perform each of the following:
./configure--prefix=/usr/local/yasm
Make
Make install
and import the YASM environment variable by the following command.
Export path= "$PATH:/usr/local/yasm/bin"
5, installation FFmpeg
Extract the FFmpeg source (ffmpeg-2.4.tar.bz2) to F:\Work\ffmpeg-2.4\ffmpeg-2.4, enter the FFmpeg code directory, respectively, execute the following command:
Compile to Static library:./configure--enable-static--enable-memalign-hack or
Compile as a dynamic library:./configure--enable-shared--enable-memalign-hack
Make note: There may be similar unable to rename Ffplay.exe:reason file exists errors, which will be resolved after defender exits.
Make install
After the compilation is complete, you can see the compilation results in the bin, include, and Lib folders of C:\msys\1.0\local. A static library is a file with a suffix of. A, and a shared library is a file with a suffix of. So.
FFmpeg Learning (a)--compiling ffmpeg under WINDOW7