Personal tools

How to build ffmpeg

From AC3Filter
Jump to: navigation, search

This instruction explains how to build ffmpeg binaries used by valib and AC3Filter.


[edit] FFMPEG 0.8.9 & MinGW (shared only)

Download MinGW-w64 x86 and x64 toolchains:

Download MSYS:


Unpack MSYS to c:\msys.

Unpack 32- and 64-bit MinGW to c:\mingw32 and c:\mingw64 respectively.

Create c:/msys/etc/fstab file with the following contents:

c:/mingw32	/mingw32
c:/mingw64	/mingw64

Run C:\msys\msys.bat (this will create the home folder at C:\msys\home\%username%).

Unpack ffmpeg source to the msys home folder (C:\msys\home\%username%). Copy valib\3rdparty\ffmpeg\ and valib\3rdparty\ffmpeg\ to ffmpeg folder, tune it if necessary and run it from msys console.

After building, copy:

[edit] Links

[edit] FFMPEG 1.1.2 & Visual Studio 2010 (static and shared)

Works with FFMPEG 1.1.3 and 1.1.4 too.

[edit] Requirements

[edit] Build environment

Install .Net framework 4. It is required for Windows SDK 7.1 to install properly.

Download and install Windows SDK 7.1. Note, that Visual Studio itself is not required! You may install Visual Studio 2010 Express instead, but you will be able to build x86 version only (Express version does not include x64 compiler).

FFMPEG requires stdint.h and inttypes.h headers standardized as a part of C99. Unfortunately, Visual Studio does not include these files. Fortunately, there is a project that fixes this issue. Download the latest version and unpack it to Visual Studio includes (C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include).

Download MSYS (32bit) and unpack MSYS to c:\msys. You may place it anywhere, but this instruction assumes this path.

Rename c:\msys\bin\link.exe to some other name (link.ex_) because it conflicts with Visual Studio's link.

Download and unpack it to c:\msys\bin.

Download yasm for Win32 and place it to c:\msys\bin\yasm.exe.

Run c:\msys\msys.bat to create user home directory (c:\msys\home\%USERNAME%. Close it.

[edit] Get FFMPEG

Download FFMPEG 1.1.2. Unpack it to the MSYS home folder (c:\msys\home\%USERNAME%).

[edit] Build

Copy, and ffmpeg_1_1_2.patch files form valib\3rdparty\ffmpeg to the root of ffmpeg.

Apply patch ffmpeg_1_1_2.patch.

From the command line run the following (assuming you have Windows SDK installed at the default location):

 "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86 /Release

This sets path to x86 compiler and starts bash shell. Run the following in the bash shell:

 cd ffmpeg-1.1.2

To build x64 version run the following form the command line:

 "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 /Release

Run the following in the bash shell:

 cd ffmpeg-1.1.2

After building, copy:

[edit] Links