You must have already fully understood
Building FFmpeg SVN dlls.
To add extra libraries to your FFmpeg binaries, you must first decide how you want those libraries to be included.
Do you want them to be statically linked to FFmpeg?
Do you want them to be external dlls that are loaded by FFmpeg?
Don't confuse this with compiling FFmpeg statically or shared. You can have all your extra libraries compiled statically into FFmpeg, and still make use of FFmpeg as shared dlls.
Think about this scenario:
Do you want to be able to change the xvidcore.dll file to any newer versions without having to recompile FFmpeg? If so, then you should build xvidcore as a shared library. If you want xvidcore to be statically linked to libavcodec, then you should build it as a static library.
The second thing you must decide is where do you want those libraries to be installed in your MSys system.
For most libraries, if you install them in default paths, you will need to pass extra arguments to FFmpeg's configure script, so that it will know where to find those libraries.
If you install each library in gcc's default include and lib path, then you won't have to specify extra search paths to FFmpeg's configure script.
If you want to keep the shared libraries in one path, and the static libraries in another (like I currently do, so it's easier to make static and shared builds), then you will also have to specify that path.
Such path is called the prefix where you install your library.
If you happen to install any library in a prefix different from gcc's default search paths, you will have to pass these arguments to FFmpeg's configure script, so that it may find the appropriate libraries:
-–extra-ldflags=-L<prefix>/lib --extra-cflags=-I<prefix>/include
Such as:
./configure --enable-memalign-hack --enable-libmp3lame /
-–extra-ldflags=-L/usr/local/lib /
--extra-cflags=-I/usr/local/include
If you want to install the libraries in gcc's default search path, so that you don't have to pass any extra arguments to FFmpeg's configure script, the prefix you want is:
/mingw
If you install the libraries as dlls, you must make sure the generated dlls are in the PATH.
Note that you may then use dlls compiled with other compilers, such as Microsoft Visual C++.
For each library I'll explain:
1. How to obtain the library;
2. How to compile statically or shared;
3. How to install to a specific prefix;
4. Which extra arguments to pass to FFmpeg's configure;
5. Example commands.
Before you start, you must make sure you have
bash version => 3.1, from Installing
bash-3.1-MSYS-1.0.11-snapshot.tar.bz2.
These are the libraries I'll show: pthreads zlib liba52 mp3lame
xvidcore <-- might not be necessary as FFmpeg provides a native mpeg4 encoder
libogg
libvorbis
libtheora
faad
faac
amr_nb
amr_wb
libdts <-- removed from FFmpeg since it now has a native implementation
libgsm
libnut <-- might not be necessary as FFmpeg provides native nut (de)muxer
x264