The compilation method of FFmpeg under Windows is attached to the FFmpeg compiled SDK download released in 2012-9-19

Source: Internet
Author: User

After one night plus a morning struggle, finally successfully compiled the latest version of the FFmpeg, the following is my compilation of experience, because it is the latest, should be useful to everyone, compiled version of the ffmpeg is 0. 11. 2,2012-09-19 the newly released version

Platform: WINDOWS Xp,mingw+msys

First, download FFmpeg

You can go to the FFmpeg official website to download the latest version: Http://ffmpeg.org/download.html Now the latest version is my compiled version;

In fact, I prefer the following address, directly listed to all the download version: http://ffmpeg.org/releases/

Second, download MinGW

1. Download

The address is: http://sourceforge.net/projects/mingwbundle/files/, click on this page download Download the zip file. Once the download is complete, install it directly and I am using the default path. (This file is larger, is Mingw+msys's merged installation package, downloaded and installed, the C:\msys\1.0\bin folder copied out, backup save);

The default path is:C:\mingw and C:\msys\1.0

2. Configure Environment variables
Right-click on "My Computer"-"Properties-" advanced-"environment variable
By operation, add C:\MinGW\bin at the end of the edit box in path

Use ";" to separate from the front

Third, download Msys

Address: http://download.csdn.net/detail/harvic880925/4602268

After downloading, or the default installation, do not uninstall before the installation of the first step in the previous version, that is, the first step of the version to cover out;

The DOS prompt window will be presented at the end of the installation:

The last sentence is:
Does the wish to continue with the post install? [Yn]
Enter N to end the installation.

Four, the bin folder will be extracted in the first step of the contents, copied to the C:\msys\1.0\bin folder to overwrite the current file;

v. in http://yasm.tortall.net/ download.html Download yasm exe file (need to choose according to their operating system is Win32.exe also Win64.exe), after downloading, renamed to Yasm.exe, placed in the MinGW installation directory of the bin directory.

Without this step, you may be prompted to not find the YASM command during the subsequent compilation of FFmpeg. FFmpeg inside the Assembly acceleration part of the code needs to use it, if the assembly acceleration is disabled, will affect the compiled codec library running efficiency

VI. Compiling

1. Follow the steps below to open "Msys.exe"

Start-"All Programs-" mingw-"msys-" MSys

2. Open "VS 2008 Command Prompt"

Start-"All Programs-" Microsoft viusal Studio 2008-"Viusal Studio tools-" Visual Studio 2008 Command Prompt

Input: C:\msys\1.0\msys.bat, such as


Do not take care of what is in front of, directly input, and then enter, then jump to the following interface:


Input: Lib return

Then you get the following interface:


Before compiling ffmpeg, there is one thing I would like to mention, if you want to support X264 encoding, to install X264 first, for how to install X264, in the following, here is assumed to have installed X264

After compiling the operation of the ffmpeg, such as I downloaded the ffmpeg name: ffmpeg-0.11.2, extracted to the D-disk;

Under the command prompt line above, enter the following code: (description in parentheses)

[CPP]View Plaincopy
    1. CD D:
    2. CD ffmpeg-0.11.2 (that is, go to the ffmpeg-0.11.2 folder)
    3. ./configure--enable-memalign-hack--enable-memalign-hack

When execution is complete, go back to the command line and enter

[CPP]View Plaincopy
    1. Make Distclean (clean up intermediate files)
    2. $./configure--enable-memalign-hack--enable-ffserver--enable-network--enable-protocols--enable-muxers-- Disable-yasm--enable-shared--enable-w32threads--enable-libx264--ENABLE-GPL--extra-cflags=-i/c:/x264/include-- Extra-ldflags=-l/c:x264/lib
    3. Make
    4. Make install

For the above command, you can use the./configure–-help to open Help, there is an explanation

After completion, all the header files, library files are saved in the C:\msys\1.0\local folder;
--extra-cflags=-i/c:/x264/include--extra-ldflags=-l/c:x264/lib These two commands are to include X264 's header and library files in the running program, However, before running this program, I took the. lib file into the Lib folder, do not know if not test will have an impact.

Here is a reference article: http://blog.sina.com.cn/s/blog_54b5ea250100r53o.html

The following is the completion of my compilation of the local folder in the entire content, for everyone to share, interested can go to download;

Address:

Special Acknowledgement: Http://ffmpeg.arrozcru.org/wiki/index.php?title=Shared_LIB

Mingw+msys compiling X264

First, download the latest X264

1, Address: http://www.videolan.org/developers/x264.html, click on the left of the big button "DownLoad X264", download do not use Sogou automatic download, because I use sogou under the Always bad package, The best button on the right click with thunder download, size has more than 500 k;

2, because is. tar.bz2 end of the compression package, commonly used WinRAR can not extract, download 7-zip, to extract, extract to Msys home folder

Position

Second, compiling X264

1. Repeat the "1-3" steps in the sixth step above

2, cut into the X264 working directory, and then compile, the overall input the following code:

CD C:

CD Msys

CD 1.0

CD Home

CD x264

./configure--enable-win32thread--enable-shared--disable-asm

Make

Make install

In this case, the required header files and DLLs are generated under the local folder of Msys, but there is no. lib file, and we use DLLs to extract LIB files;

Iii. extraction of Lib

1. Download tool: Poxports, Address: http://download.csdn.net/detail/harvic880925/4603881

Put the Pexports.exe in the VS2008 VC\bin directory, mine is D:\Program Files\Microsoft VisualStudio 9.0\vc\bin,

2. Copy the DLL files generated under the Msys local folder to the D:\ProgramFiles\Microsoft Visual Studio 9.0\vc\bin directory, for example, I generated a DLL named: Libx264-128.dll

3. Click Start-"All Programs-" MicrosoftVisual Studio 2008-"Visual Studio tools-" Visual Studio 2008 Command Prompt

This opens the VS2008 command prompt interface

Input: (description in parentheses)

CD bin (switch to bin directory)

Pexports Libx264-128.dll > Libx264-128.def

Lib/machine:ix86/def:libx264-128.def

(The above is to avoid errors can be copied directly, paste to the command line)

To this should be in D:\ProgramFiles\Microsoft Visual Studio 9.0\vc\ Libx264-128.lib file is generated under the bin, if there is no re-execution of the next 3rd step, I first appeared a warning did not succeed, the second time to succeed.

I upload my generated files to my resources, do not receive points, want to be able to download:

FFMPEG (2012-9-19): http://download.csdn.net/detail/harvic880925/4604774

X264 Address: http://download.csdn.net/detail/harvic880925/4603907

[CPP]View Plaincopy

The compilation method of FFmpeg under Windows is attached to the FFmpeg compiled SDK download released in 2012-9-19

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.