• MinGW and MSys
  • FFmpeg
  • What's next?

    Building FFmpeg on Windows HowTo

    Author: Guilhem Tardy
    Last update: March 15, 2005

    The following instructions will take you through the steps necessary to install MinGW and MSys, then build FFmpeg under Windows.

    Setting up MinGW and MSys

    If you are using Windows, you need to install the current MinGW and MSys, available here (external link).

    MinGW is the set of libraries and header files, combined with the GCC toolset and necessary to build an application under Windows. MSys is a minimal, POSIX compliant system with support for the Bourne shell necessary to the configure scripts.

    For in-depth Unix and Linux command line information, please refer to the MinGW and other websites. Suffice to say that there is a direct correspondance between directories in MSys and Windows (please note the difference between slash and backslash):

    is equal to
    E:\Program Files\MSys\home\Administrator\ffmpeg-0.4.7

    To find out what is your home directory, type pwd at the start on the MSys command line. For the sake of this guide, we will assume /home/Administrator from now on.

    Make sure that MinGW was properly installed by checking that the file /etc/fstab (for a Windows editor, this is E:\Program Files\MSys\etc\fstab) contains the line:

    E:/Progra~1/MinGW /mingw

    Make a link to the directory containing the FFmpeg-0.4.7 library from your home directory in MSys. For this, you need to edit the file /etc/fstab. Add the line:

    F:/devel/ffmpeg-0.4.7 /home/Administrator/ffmpeg-0.4.7

    And create the corresponding directory in MSys:

    mkdir /home/Administrator/ffmpeg-0.4.7

    This directory is empty for all what Windows is concerned, but the MSys command line will make it appear like the directory chosen for FFmpeg-0.4.7 (in this example, F:/devel/ffmpeg-0.4.7). At this point, you need to restart MSys.

    Building FFmpeg

    It is recommended to use the fully patched FFmpeg-0.4.7 library available here.

    You may also download a pristine FFmpeg version 0.4.7 here (external link), and apply the patch available here.

    Please decompress FFmpeg-0.4.7 to the directory of your choice (in the MSys example above, F:/devel/ffmpeg-0.4.7).

    Then, enter the directory containing the FFmpeg-0.4.7 library, and if it isn't already done, apply the patch.

    cd ffmpeg-0.4.7
    patch --dry-run -p1 < ffmpeg-0.4.7.patch

    If no error message appears, then:
    patch -p1 < ffmpeg-0.4.7.patch

    Let's continue with the configuration:

    ./configure --enable-shared --disable-a52 --disable-pp --disable-ffserver --disable-ffplay
    cd libavcodec

    ./configure --extra-cflags="-mno-cygwin -mms-bitfields" --extra-ldflags="-Wl,--add-stdcall-alias" --enable-mingw32 --enable-shared --disable-a52 --disable-pp --disable-ffserver --disable-ffplay
    cd libavcodec

    This is it. You don't need to build libavformat (it won't work anyway), but the files libavcodec.dll and avcodec.h should be copied to an appropriate directory where the OpenH.323 development environment and your applications will find it.

    What's next?

    We have been working hard over the past year to expand the set of features:

    • H.263+ & MPEG-4 codecs (ffmpeg-cvs)
    • custom picture sizes
    • dependable rate control
    • incremental, "no key frame" refresh
    • incremental (independent packet) & multi-threaded encoding
    • incremental (independent packet) decoding
    • use of the RTP payload header to correct errors
    • pro-active error resilience in the bitstream
    • refresh of selected (erroneous) parts of the picture
    • and more parameters available to the applications.
    The latest Salyens plugin for Java and native, multi-platform applications are now production stable, earning praises for their versatility, efficiency and small footprint. Please contact us for more details.

    You may continue with one of the two following tutorials:
    Add H.263 to OpenH.323
    JFFmpeg Documentation (external link)