ffmpeg 1.1后的版本支持 命令行的msvc 2010 后的版本编译。
为了上架MS 应用商店,必须用 微软的编译器编译 ffmpeg,x264,否则出现安全检查的问题。
见ffmpeg 官网,有具体的编译方法。
http://ffmpeg.org/platform.html#Native-Windows-compilation-using-MinGW-or-MinGW_002dw64
通过一个语法转换工具,把C99转换了
mingw的环境变量设置
/bin/profile
export PATH="/C/Program Files/Microsoft Visual Studio 10.0/Common7/IDE:$PATH"
export PATH="/C/Program Files/Microsoft Visual Studio 10.0/VC/bin:$PATH"
export INCLUDE="/C/Program Files/Microsoft Visual Studio 10.0/VC/include"
export INCLUDE="/C/Program Files/Microsoft SDKs/Windows/v7.1/Include:$INCLUDE"
export LIB="/C/Program Files/Microsoft Visual Studio 10.0/VC/lib"
export LIB="/C/Program Files/Microsoft SDKs/Windows/v7.1/Lib:$LIB"
config-ffmpeg.sh
cd ffmpeg_src
FLAGS="$FLAGS--prefix=../build"
FLAGS="$FLAGS --toolchain=msvc"
FLAGS="$FLAGS --disable-iconv "
FLAGS="$FLAGS --disable-everything"
#For gpl
FLAGS="$FLAGS --enable-gpl"
FALGS="$FLAGS --enable-runtime-cpudetect"
FLAGS="$FLAGS --disable-network "
FLAGS="$FLAGS --enable-asm --disable-debug"
#For LIBS
FLAGS="$FLAGS --enable-static --disable-symver"
FLAGS="$FLAGS --disable-shared "
#For x264
FLAGS="$FLAGS --enable-decoder=mpegvideo "
FLAGS="$FLAGS --enable-decoder=mpeg1video --enable-encoder=mpeg1video "
FLAGS="$FLAGS --enable-decoder=mpeg2video --enable-encoder=mpeg2video "
FLAGS="$FLAGS --enable-decoder=mpeg4 --enable-encoder=mpeg4"
#For libx264
FLAGS="$FLAGS --enable-decoder=h264 --enable-parser=h264"
FLAGS="$FLAGS --enable-encoder=libx264 --enable-libx264"
./configrue $FLAGS
make;make install
/
build_x264.sh
cd x264_src
FLAGS="$FLAGS--prefix=../build"
FLAGS="$FLAGS --enable-win32thread --enable-shared --enable-static --enable-strip "
EXTRA_LDFLAGS="-Wl,--output-def=libx264.def"
./configure $FLAGS --extra-ldflags="$EXTRA_LDFLAGS"
#ffmpeg need this libx264.exp 文件;否则link不上
#create libx264.lib
LIB /MACHINE:X86 /DEF:libx264.def
cp libx264.lib ../ffmpeg_src/
cp libx264.exp ../ffmpeg_src/
make;make install