Building ffdshow

Prerequisites

Optionally:

Getting the source code

Create a blank directory whose full path does not contain any spaces. Assuming you have installed TortoiseSVN, right click the directory in Windows Explorer, choose “SVN Checkout” from the context menu.

Enter “https://ffdshow-tryout.svn.sourceforge.net/svnroot/ffdshow-tryout/” as the URL of the repository. This would check out all branches of the source code, so if you are only interested in one particular branch (like “trunk”, which is where the completed changes are added and where releases are again branched from), click on the ”…” button next to the repository URL list box and select the desired branch.

Installing prerequisite software

Installing Microsoft Visual Studio 2010

The required components are:

  • Visual C++ Tools > Win32 Tools
  • Visual C++ Run-time Libraries
  • Visual C++ Class & Template Libraries

Optionally:

  • x64 Compilers And Tools if you want to build the 64-bit version

Installing Microsoft DirectX SDK

The required component is:

  • DirectX Headers and Libs

Configuring Compilers

Intel Parallel Composer 2011

The ICL12 project files require that you have MSVC 2010 installed. All ffdshow components are built with ICL12 except for the components which MinGW/GCC is used. Just open the solution file ffdshow_icl12.sln and build Release|Win32.

ICL12 can compile ffmpeg. It is slow and may or may not work. A lot of optimized CPU specific code is disabled because ICL12 for Windows does not fully support GCC/GAS style inline assembler. If it works and can reproduce the same bugs that are found in GCC builds, you can use ICL12 for debugging purpose.

Configuring MinGW

Assuming that MinGW was installed to C:\MinGW, browse to C:\MinGW\bin:

  • Make a copy of 'mingw32-make.exe' and name it 'make.exe'
  • Make a copy of 'gcc.exe' and name it 'cc.exe'
  • Put 'yasm.exe' in the 'bin' directory

The first two steps are required for 'TDM's MinGW', and can be skipped when using the custom MinGW installer or any other MinGW.

An alternative method to renaming (and the preferred one) is to set the following environment variables (adjust the paths to your paths):

MINGW32=C:\MinGW
MSYS=C:\msys\1.0
Path=%MINGW32%\bin;%MSYS%\bin;

Compiling the project

  • ffmpeg.dll must be compiled using GCC.
  • Xvidcore has a much better performance (+30% speed gain) when compiled with GCC so you better compile Xvidcore with GCC too.
  • The same goes for KernelDeint.
  • The rest of the project can be compiled using Visual Studio or ICL.

Make command line options

To build dlls using MinGW, launch MSYS or cmd.exe (if you have added the needed environment variables) and go to the ffdshow source directory.
Type:

make

or if you have a quad core CPU:

make -j4

This should build x86 version of ffdshow.

If you are building the 64-bit version, type:

make 64BIT=yes

or if you have a quad core CPU:

make -j4 64BIT=yes

Compiling with MinGW

assuming you added MinGW\bin folder to the path, launch MSYS or cmd.exe and navigate ('cd') to each of the following directories:

  • src\ffmpeg
  • src\imgFilters\KernelDeint
  • src\codecs\xvidcore

inside each directory, type 'make' and press Enter.

OR you can browse to the src dir and run make. All dlls which are meant to compile with GCC will be compiled.
There's even a “MakeAll.bat” batch file in the root dir for those who prefer that.

Choosing the best compiler

MSVC can build most files of ffdshow, but this is not always recommended:

  • libavcodec, libmpeg2, xvidcore: These files are originally Linux projects. GCC should be used for release builds. MSVC may be able to compile some of these, which is useful for debugging purposes. Also note that libmpeg2 is faster when compiled with ICL (~+15%).
  • KernelDeint, TomsMoComp: For best performance, GCC is preferred.
  • ffdshow.ax: MSVC or ICL12. ICL12 is faster when filters are used, while MSVC is good enough for most cases.

Installing the files you have just built

After building ffdshow.ax, call bin\register.bat and install the new files. The 'bin' directory is the new installation directory, do not copy the files to “Program Files\ffdshow”. ffdshow.ax requires that the dlls are in the same directory.
You have to double click bin\register64.bat manually if you are building x64 version (see the bat for the reason).

Creating an installer

Double click bin\distrib\InnoSetup\ffdshow_installer.iss. Read the first five lines and enter appropriate values. Press F9 to build or Ctrl+F9 if you use InnoIDE.
Note: Don't use ISTool since it has problems with Unicode.

devel/building.txt · Last modified: 2012/03/31 02:40 by h_yamagata
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki