Saturday, May 03, 2008

compile ffdshow

The ffdshow trunk I downloaded is version 20071127. It seems that another ffdshow project called “ffdshow tryout” has been forked from the original ffdshow project on SourceForge and this new project is more active and new developers probably should check this out first before downloading the latest SVN build from the main ffdshow project.

It has also been discussed (can't remember it is from AVSforum or Doom9) that the project is no longer supported on VC6, so I have to upgrade my VC to Visual Studio 2005. Also note that DirectX 9 SDK is required to compile the project. Some codes have been hand written in assembly language for better performance. That can be either compiled by NASM or YASM. The latter is basically a rewrite of the former but under BSD license. Those two assemblers should be placed under Visual Studio installation directory and under “VC\bin” directory then VS2005 can find them during building. Note that the rule files are included in the checked out source files and they also need to be copied to “VC\VCProjectDefaults” directories. That way, when we right click the project, we can then choose “Custom Build Rules” to edit the options. For example, you should remove –DHAVE_SSE3 or some other options if that is not supported by your CPU. The options I have been using are:

nasm –f win32 –DPREFIX –DWIN32 –I$(InputDir) –o $(IntDir)\$(InputName).obj $(InputPath)

That should work on most platforms but the performance may not be the best because some SSE based optimization is not being used.


When compiling the project, I saw some errors and it appeared that nasm complained about those 64-bit operands used in file cpuid64.asm. I just right clicked it and excluded it from the project since I am not working on a 64-bit platform. Then, the whole project compiled and I got a DirectShow filter called ffdshow.ax. A DirectShow filter is a COM object and we will need register it first before using it.


The project already contains a batch file called register.bat, but it basically just uses the following command to do the job:

regsvr32 ffdshow.ax

0 Comments:

Post a Comment

<< Home