FFMEPG MinGW + vs2012 Compilation

Source: Internet
Author: User

Online There are many MinGW compiled ffmpeg introduction, but it is difficult to successfully complete, sorting out some information on the web to compile the process of a bit, easy for everyone to use

1, build MinGW environment, here do not do too much introduction, online a lot of

2, Installation Yasm

Address: http://yasm.tortall.net/Download.html, if you do not need x264 support can not install

Rename the Yasm.exe to the C:\WINDOWS\system32 or C:\MinGW\msys\1.0\bin folder.

3, Installation Pkg-config

Download Pkg-config-0.23-2.zip and Glib_2.18.4-1_win32.zip

Http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.23-3_win32.zip
Http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.18/glib_2.18.4-1_win32.zip
Put the Libglib-2.0-0.dll in Pkg-config.exe and Glib_2.18.4-1_win32.zip in the bin directory of MinGW.

4. Install C99 compilation environment ( if vs2013 +, skip this step )

download c99-to-c89:https://github.com/libav/c99-to-c89/downloads or http://pan.baidu.com/s/1mgHs18s

Copy C99conv.exe and C99wrap.exe to: D:/mingw/msys/1.0/bin directory;


C99 header Files Inttypes.h and stdint.h: http://code.google.com/p/msinttypes/downloads/list or/http Pan.baidu.com/s/1o6srths

vs2012 simply copy the inttypes.h header file to: C:\Program Files\Microsoft Visual Studio 11.0\vc\include directory;

5. Configure Environment variables

Open the%msys_home%/1.0/etc/profile file and add the following code

If [-Z "$pkg-config"]; Then

Export Pkg-config=/c/mingw/bin/pkg-config.exe

Fi

6. Configuring the compilation Environment

1, copy: C/mingw/msys/1.0/msys.bat to the same directory, changed name is called Msys_vs2012.bat

2. Add: Call "C:\Program Files\Microsoft Visual Studio 11.0\vc\bin\vcvars32.bat" in msys_vs2012.bat opening section;

3, rename D:/mingw/msys/1.0/bin/link.exe to Link_renamed.exe, this step is to prevent the Link.exe and VC link.exe conflict, after the completion of the compilation Remember to change back;

7. Compiling

Open Msys_vs2012.bat, go to the directory you want to compile

1. x264 compilation
In order for the compiled ffmpeg to support encoding and decoding of the x264 format, you need to download x264 first.
To: http://www.videolan.org/developers/x264.html download
The file name is similar to: LAST_X264.TAR.BZ2 package.

LAST_X264.TAR.BZ2 to: C:\MinGW\msys\1.0\home\duxp\plugin\ directory, double-click "C:\MinGW\msys\1.0\msys.bat", Start "MinGW32", To switch to the x264 directory:
Then execute the following command:
$./configure--prefix=/usr/local/vs2012--enable-static--enable-win32thread

$ make
$ make Install
Compilation results in: C:\MinGW\msys\1.0\local\vs2012 directory

2. FFmpeg compilation

$./configure--prefix=./vs2012_build--ENABLE-GPL--enable-nonfree--enable-postproc--enable-avfilter-- Enable-w32threads--enable-runtime-cpudetect--enable-memalign-hack--enable-libx264--disable-debug--extra-cflags = '-i/usr/local/vs2012/include '--extra-ldflags= '-l/usr/local/vs2012/lib '

Make

Make install

FFMEPG MinGW + vs2012 Compilation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.