compile ffmpeg for windows 64-bit

一、编译步骤:

git config --global core.autocrlf false
 
git clone git://git.videolan.org/x264.git x264
cd x264
./configure --host=x86_64-w64-mingw32 --enable-static --enable-shared && make && make install
cd ..
 
git clone git://github.com/mstorsjo/fdk-aac.git fdk-aac
cd fdk-aac
./autogen.sh
./configure --host=x86_64-w64-mingw32 --enable-static --enable-shared && make && make install
cd ..
 
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-nonfree --enable-libx264 --enable-libfdk_aac 、
--enable-static --disable-shared 、
--extra-cflags=-I/local/include 、
--extra-ldflags='-L/local/lib -static' 

&& make && make install
 
  
二、注意问题

1、You need to use git to download the source of x264, build it, install it and make sure that when you build ffmpeg, it knows where to find it (--extra-cflags and --extra-ldflags in the final configure line). This is what the shell commands above already do anyway though.

2、“-static” makes it a static binary. ldflags加上static的意义:

This means that it puts all of the code it needs into one big executable. If you remove this, it should still work and the executable file will be smaller, but you will need to make sure you have all of the DLLs (libx264.dll, libavfilter, etc) in the same place.

你可能感兴趣的:(视频编解码)