Cannot build in ffmpeg

I’m trying to build in ffmpeg, and I am getting an error

/home/martin/blender/svn/blender/intern/audaspace/ffmpeg/AUD_FFMPEGReader.h:36:34: error: libavformat/avformat.h: No such file or directory

However I have /usr/include/ffmpeg/libavformat/avformat.h.

My CMakeCache.txt file has

//FFMPEG Directory
//FFMPEG Libraries
//Enable FFMPeg Support (

I have tried various values for the filepath but they all give the same error. Does anyone know the correct setting?

For information:

> uname -a
Linux edward.sunmoonstars #1 SMP Mon Apr 5 16:15:03 EDT 2010 i686 i686 i386 GNU/Linux
> ~/blender/blender/blender -v 
Blender 2.52 (sub 5) Build
    build date: 2010-04-21
    build time: 09:59:05
    build revision: 28315
    build platform: Linux
    build type: 

Sorry to ask lots of questions, but hopefully others will also benefit from the answers.


I have now downloaded ffmpeg from svn and built it, and modified my CMakeCache.txt to point to the downloaded files. This build gives me the same error.

I had a lot of pain building Blender 2.5 with FFMPEG on Linux karmic Koala 64bit and that included building FFMPEG from svn. But now solved.

  1. Make sure all traces of FFMPEG are removed from your system before building FFMPEG.

  2. Build FFMPEG and install to /usr. Trying to build Blender with a local FFMPEG and keep system one will not work and give you errors.

  3. Build Blender (I use scons) ensuring has FFMPEG enabled and located at PREFIX /usr.

Good Luck.

It is certainly a very complex set of buildfiles. I have tried to debug the error. At any rate the c++ line is not being passed anything like -I/usr/include which is what we might want to pick up the system ffmpeg. It does get passed -I/usr/include/AL but that does not give us what we want. It seems to be overriding the CMakeCache file by using pkg-config, and that should give the right results, but iyt is not.

Do you have libavformat-dev installed ?

I’m on Fedora, so it is called ffmpeg-devel, which I have installed.

I’ve dumped cmake and rebuilt using scons, and that worked, so I’m ok now thanks.

Could you post the steps you took … I’m not so experienced with compiling, and I’m in the same situation right now

3hot, it was several months ago and I can’t remember the exact steps, but basically there are two ways to build Blender that are documented, one using a tool called cmake and the other using another tool called scons. What worked for me was to follow the scons path as documented. This basically means installing scons and Python and then typing scons (in the top level source directory).

This was on Linux (Fedora). I’ve subsequently found that python disagrees with the MSYS environment for MS Windows, and scons needs python, so don’t try that there. I expect it would work under cygwin or using the MS toolchain, though I havn’e tried either for blender.

Thanks for the quick response. I made it through ffmpeg (… changed the value of BF_FFMPEG_INC to appropriate system install path). Got a compiled Blender that won’t execute – exits with the following error message:

found bundled python: /home/t2hot/blender-svn/install/linux2/2.52/python
Fatal Python error: Py_Initialize: can’t initialize sys standard streams
ImportError: No module named encodings.utf_8
… frustrating.

you might need to ask in another place; it doesn’t look like a build error any more. (Unless you are picking up the wrong python or the wrong ffmpeg; if it was the wrong ffmpeg I would have expected a quite different error; you could try playing with the use-blender-python/use-installed-python options).

Okay … this is where I’m blank. Where do those settings/options reside and what values are applicable? I’m using fedora 13-x86_64.

If you run scons from the blender source code directory with the --help option, it will list lots of options. Then you can run scons with these options on the command line. I’m not sure which options you need in your case but you will see lots of BF_PYTHONxxx options that might help.