No avformat module when compiling with latest ffmpeg

I compiled/installed ffmpeg in /usr/local because the installation in /usr (with checkinstall) fails because it tries to overwrite files installed with ffmpeg related packages (libswscale-dev, libavcodec-dev etc.) which are dependencies of some other programs I use. Everything compiles fine but kdenlive first run wizard reports missing avformat module. I used recommended options except --enable-libamrnb and --enable-libamrwb which are reported as unknown by configure script.

This is all on Ubuntu 9.04 and when I compile only with ffmpeg from repo's avformat module is present.

What is baffling is that I have the same setup with ffmpeg in /usr/local on another machine which works (although the ffmpeg is from April this year).

Does anyone have any idea what is going wrong? Should I pass some options to mlt ./configure or is the problem with ffmpeg or possibly even kdenlive?

Probably kdenlive is trying to link with the system versions of libavcodec etc and failing because they are incompatible. When you are compiling ffmpeg and kdenlive in /usr/local and there are other copies of the same programs in /usr then you need to enter

$ export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib

before running kdenlive so it looks in /usr/local/lib first for the new libraries. Alternatively, set

$ export LD_RUN_PATH=/usr/local/lib:/usr/lib:/lib

before compiling ffmpeg, mlt and kdenlive.

I had the same problem and the export trick works to fix the issue for the command line, but when executing kdenlive from the menu, in gnome at least, it results in AVformat module failing to be detected. I read somewhere (edit: ejolson has said the same thing) that you needed a "export LD_RUN_PATH=/usr/local/lib:/usr/lib:/lib" before compiling ffmpeg, mlt and kdenlive, but this didn't work for me. Same issue persists. So... does anyone know how to fix the execution from the gnome menus?

did it work for you ejolson?

Another solution to this problem: I noticed after installing the Ubuntu Karmic kdenlive + ffmpeg packages that I had some libraries I forgot to remove before installing everything from source. These were hidden in /usr/lib/i686

So one should at least move or delete that directory, i.e.
mv /usr/lib/i686 /usr/lib/i686-old
Then check dynamic libs called by your source-compiled ffmpeg:
ldd /usr/bin/ffmpeg
Here's what I get, and kdenlive 0.7.7 (rev.4139) now works: => (0x00cbd000) => /usr/lib/ (0x009f0000) => /usr/lib/ (0x00f15000) => /usr/lib/ (0x00f55000) => /usr/lib/ (0x00836000) => /usr/lib/ (0x00f62000) => /usr/lib/ (0x00756000) => /usr/lib/ (0x008f8000) => /lib/tls/i686/cmov/ (0x00110000) => /lib/tls/i686/cmov/ (0x00abe000) => /lib/tls/i686/cmov/ (0x00136000) => /usr/lib/ (0x0027a000) => /usr/lib/ (0x002ed000) => /usr/lib/ (0x004b4000) => /usr/lib/ (0x004d0000) => /usr/lib/ (0x00437000) => /lib/ (0x00e39000) => /lib/ (0x003b4000) => /usr/lib/ (0x00951000) => /usr/lib/ (0x00e17000) => /usr/lib/ (0x00f41000) => /usr/lib/ (0x005ff000) => /usr/lib/ (0x003c6000) => /usr/lib/ (0x003f9000) => /usr/lib/ (0x00693000) => /usr/lib/ (0x00ad7000) => /usr/lib/ (0x00447000) => /usr/lib/ (0x00bd1000) => /usr/lib/ (0x00cbe000) => /lib/tls/i686/cmov/ (0x00413000)
/lib/ (0x00676000) => /usr/lib/ (0x00417000) => /lib/tls/i686/cmov/ (0x00427000) => /usr/lib/ (0x04ca7000) => /usr/lib/ (0x00472000) => /usr/lib/ (0x00485000) => /usr/lib/ (0x00430000) => /usr/lib/ (0x067fe000) => /lib/ (0x00e5f000) => /usr/lib/ (0x00768000) => /usr/lib/ (0x004a3000) => /usr/lib/ (0x004aa000)

ffmpeg was compiled with:
./configure --prefix=/usr --enable-shared --enable-libmp3lame --enable-gpl --enable-libfaad --enable-libfaadbin --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libx264 --enable-libdc1394 --enable-nonfree --disable-stripping --enable-avfilter --enable-libdirac --disable-decoder=libdirac --enable-libschroedinger --disable-encoder=libschroedinger --enable-avfilter-lavf --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3

MLT compiled with:
./configure --prefix=/usr --enable-gpl --qimage-libdir=/usr/lib/ --qimage-includedir=/usr/include/qt4 --avformat-swscale --enable-mmx