Building FFMpeg

16 June 2012
In the past building FFMpeg for Windows had to be done by cross-compiling from Linux, which is OK if you are a cross-platform developer, but an utter pain if you only develop for Windows (my own company went Windows-only a few months ago). Nowhere near as challenging as recompiling GTK, but also not without its gotchas.

Once configuration is finished, start the build & install. On a 2010 Quad-Core i7 860 with 4GB RAM it took about 10 minutes.

make && make install

All done. Your newly build FFmpeg should be under D:\FFmpeg. Enjoy.. :)

Only building H.264 decoder

If you are only interested in building H.264 decoding libraries, you can add the following switches to the configure command. Bear in mind that intra-dependencies within FFmpeg sometimes change, so in a future build this list might become shorter:

The problem is that lib.exe (which creates the .lib files) is called during the building stage, and if not present it fails silently. It is not enough to run make again - you have to do a make clean and do rebuild from scratch.

YASM not found

FFmpeg is a collection of programs and libraries, and the inter-dependencies change with time. Don't be too surprised if you get errors like the following when you use the same configure script parameters with an upgraded FFmpeg source tree:

Chances are you are using headers from a previous version of FFmpeg, which is something that has a tendency to break the decoder. Clearing out the old headers and instead rebuilding using the new ones solved the problem.