windows下MinGW编译ffmpeg+x264+lame+fdk-aac

关于编译环境的搭建,网上很多,主要说下编译中遇到的坑,

ffmpeg2.6.9

x264-snapshot-20170521

lame3.99.5

fdk-aac-0.1.4

1.编译lame ,需要删除 configure 文件中 xmmintrin.h再编译

./configure --disable-shared \

--disable-frontend \

--enable-static \

--prefix=$(pwd)/build/

make clean

make -j4

make install

 

2.编译x264

./configure --enable-static \
--enable-pic \
--enable-strip \
--disable-cli \
--disable-asm \
--prefix=$(pwd)/build/

make clean
make -j4
make install


3.编译fdk-aac

#!/bin/bash
./configure --enable-static \
--disable-shared \
--prefix=$(pwd)/build/
make clean
make -j4
make install

4.编译精简版ffmpeg

#!/bin/bash
PREFIX=/c/build_full
external_libs=/c/external_libs
./configure --prefix=$PREFIX \
--enable-gpl \
--enable-memalign-hack \
--enable-w32threads \
--enable-shared \
--disable-stripping \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-ffprobe \
--disable-avdevice \
--disable-indevs \
--disable-devices \
--disable-debug \
--disable-asm \
--disable-yasm \
--disable-doc \
--disable-bsfs \
--disable-indevs \
--disable-outdevs \
--enable-bsf=aac_adtstoasc \
--enable-bsf=h264_mp4toannexb \
--enable-small \
--enable-dct \
--enable-dwt \
--enable-lsp \
--enable-mdct \
--enable-rdft \
--enable-fft \
--disable-iconv \
--disable-static \
--enable-version3 \
--enable-nonfree \
--disable-encoders \
--enable-encoder=pcm_s16le \
--enable-encoder=aac \
--enable-encoder=libmp3lame \
--enable-encoder=libfdk_aac \
--enable-encoder=libx264 \
--enable-encoder=mp2 \
--disable-decoders \
--enable-decoder=aac \
--enable-decoder=mjpeg \
--enable-decoder=png \
--enable-decoder=flv \
--enable-decoder=gif \
--enable-decoder=mp3 \
--enable-decoder=h264 \
--enable-decoder=pcm_s16le \
--disable-parsers \
--enable-parser=mjpeg  \
--enable-parser=png  \
--enable-parser=aac  \
--enable-parser=h264  \
--enable-parser=mpeg4video  \
--enable-parser=mpegvideo  \
--enable-parser=mpegaudio  \
--disable-muxers \
--enable-muxer=avi \
--enable-muxer=flv \
--enable-muxer=mp4 \
--enable-muxer=m4v \
--enable-muxer=mp3 \
--enable-muxer=mov \
--enable-muxer=h264 \
--enable-muxer=wav \
--enable-muxer=adts \
--disable-demuxers \
--enable-demuxer=mjpeg \
--enable-demuxer=m4v \
--enable-demuxer=gif \
--enable-demuxer=mov \
--enable-demuxer=avi \
--enable-demuxer=flv \
--enable-demuxer=h264 \
--enable-demuxer=aac \
--enable-demuxer=mp3 \
--enable-demuxer=wav \
--disable-protocols \
--enable-protocol=rtmp \
--enable-protocol=file \
--enable-protocol=http \
--disable-filters \
--enable-filter=transpose \
--enable-filter=crop \
--enable-filter=vflip \
--enable-filter=hflip \
--enable-libx264 \
--enable-libfdk_aac \
--enable-libmp3lame \
--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"
make clean
make -j4
make install

 

说明:--disable-iconv 是使得到的库,在程序调用运行时,不需要导入libiconv-2.dll

iconv是用来转换文件的编码方式,比如可以将UTF8编码的转换成GB18030的编码,完全可以去掉

-static-libgcc  是使得到的库,在程序调用运行时,不需要导入libgcc_s_dw2-1.dll

 

 

你可能感兴趣的:(ffmpeg)