关注于视频技术领域的相关资讯,研发和产品

How to build ffmpeg with x264 on windows platform

2009-06-02 开发 查看评论 查看(2,443)

First, download some tools of the trade and the source for ffmpeg and x264

  1. Download MinGW from here.
  2. Download MSYS from here.
  3. Download updated bash for MSYS from here.
  4. Download updated w32api-3.13-mingw32-dev.tar for MinGW from here.(here is a direct link).
  5. Get the latest snapshot of ffmpeg from here (here’s a direct link).
  6. Get the latest snapshot of x264 from here.
  7. Download updated yasm for compiling x264 from here.

Let’s install the tools.

  1. Install MinGW (choose “MinGW base tools” and “MinGW make”) into c:\mingw
  2. Install MSYS into c:\msys\1.0
  3. After MSYS installation it will run a postinstall script. It will ask you some questions which you should answer as following:
    Do you wish to continue with the post install? [yn ] -> y
    Do you have MinGW installed? [yn ] -> y
    Where is your MinGW installation? -> C:/mingw
  4. Copy bash-2.05b-MSYS.tar.bz2 to c:\msys\1.0 and extract it (bash.exe should go into C:\MSYS\1.0\bin).
    We need to do this because ffmpeg’s configure script doesn’t work with bash 2.0.4 that comes with MSYS.
  5. Extract the w32api-3.13-mingw32-dev.tar to c:\minGW.
  6. Rename yasm-0.7.2-win32.exe to yasm.exe, and copy yasm.exe to c:\sysm\1.0\bin for compiling x264.
  7. Extract the ffmpeg and x264 sources. I’ll assume you’ve extracted them to c:\work\ffmpeg and c:\work\x264.

Now it’s time to build the library.

  1. launch the MSYS, then, in c:\work\x264, perform the following command:
    ./configure –prefix=/static –enable-shared

  2. run the following commands: make, make install.
    there will exist x264.h in static/include,  and libx264.a in static/lib
  3. in c:workffmpeg and perform the following command:
    ./configure –enable-memalign-hack –enable-shared –disable-static –enable-gpl  –enable-libx264  –enable-avisynth –extra-cflags=-I/static/include –extra-ldflags=-L/static/lib
  4. make
  5. In order to run ffmpeg.exe, collect the binary files and put them together in one folder:
    ffmpeg\ffmpeg.exe
    ffmpeg\libavcodec\avcodec-51.dll
    ffmpeg\libavformat\avformat-51.dll
    ffmpeg\libavutil\avutil-49.dll
    ffmpeg\libavdevice\avdevice-52.dll

 

本文来自: How to build ffmpeg with x264 on windows platform

发表评论

*
请输入验证码(不区分大小写)
Anti-spam image