关于编译环境的搭建,网上很多,主要说下编译中遇到的坑,
ffmpeg2.8.1
x264-snapshot-20170521
lame3.99.5
fdk-aac-0.1.4
mingw32-4.8.2.rar
MSYS-1.0.11.rar
glib_2.26.1-1_win32.zip , pkg-config_0.26-1_win32.zip, coreutils-5.3.0-bin.zip,coreutils-5.3.0-dep.zip
yasm.exe.
将pkt-config.exe,yasm.exe放入c:/mingw32/bin下
glib下的bin里面的dll放入c:/mingw32/bin下
coreutils-5.3.0-bin的bin下的pr.exe放入c:/mingw32/bin下
coreutils-5.3.0-dep的bin下的dll放入c:/mingw32/bin下,同时复制一份,改名为intl.dll iconv.dll
1.编译lame
#!/bin/bash
./configure --disable-shared \
--disable-frontend \
--enable-static \
--prefix=/c/external_libs/lame
make
make install
2.编译x264
#!/bin/bash
./configure --enable-static \
--enable-pic \
--enable-strip \
--disable-cli \
--prefix=/c/external_libs/x264/
make
make install
3.编译fdk-aac
#!/bin/bash
./configure --enable-static \
--disable-shared \
--prefix=/c/external_libs/fdk-aac/
make
make install
4.编译ffmpeg
#!/bin/bash
PREFIX=/c/build
external_libs=/c/external_libs
./configure --prefix=$PREFIX --enable-shared --disable-static \
--disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-pic --enable-gpl --enable-version3 --enable-nonfree \
--enable-libx264 --enable-libmp3lame --enable-libfdk_aac \
--enable-w32threads \
--disable-doc --enable-avfilter \
--extra-cflags="-I$external_libs/fdk-aac/include -I$external_libs/x264/include -I$external_libs/lame/include" \
--extra-ldflags="-static-libgcc -L$external_libs/fdk-aac/lib -L$external_libs/x264/lib -L$external_libs/lame/lib"
说明:-static-libgcc 是使得到的库,在程序调用运行时,不需要导入libgcc_s_dw2-1.dll
版权声明:本文为bixinwei22原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。