1. 程式人生 > >ffmepg windows平臺下編譯

ffmepg windows平臺下編譯

在windows平臺下需要編譯一些模組進去,並開啟除錯版本.

先編譯 libx264和libfdk-aac

#下載x264
wget ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
tar -jxvf last_x264.tar.bz2
mv x264-snapshot-20170711-2245 x264

#curl ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2 -o x264.tar.bz2
#tar -jxvf x264.tar.bz2
#mv x264-snapshot-20170711-2245 x264


#下載fdk-aac
wget https://github.com/mstorsjo/fdk-aac/archive/master.zip
mv master.zip fdk-aac-master.zip

#curl https://codeload.github.com/mstorsjo/fdk-aac/zip/master -o fdk-aac-master.zip

unzip fdk-aac-master.zip
mv fdk-aac-master fdk-aac


mkdir help

#編譯模組
cd x264
./configure --help > ../help/x264.txt

./configure \
--enable-shared \
--enable-static \
--disable-asm \
--prefix=$(pwd)/../local/
make
make install
make clean
cd ..

#
cd fdk-aac
./autogen.sh
./configure --help > ../help/fdk-aac.txt

./configure \
--enable-shared \
--enable-static \
--prefix=$(pwd)/../local/
make
make install
make clean
cd ..
再編譯ffmpeg
LOCAL=$(pwd)/local
export PATH=”$PATH:$LOCAL/bin"
export C_INCLUDE_PATH="$C_INCLUDE_PATH:$LOCAL/include"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LOCAL/lib”

cd ../ffmpeg-2.8.12
mkdir $LOCAL/../help/
./configure --help > $LOCAL/../help/ffmpeg.txt

./configure \
--enable-shared \
--enable-static \
--enable-debug \
--enable-memalign-hack \
--enable-libx264 \
--enable-libfdk-aac \
--enable-gpl \
--enable-nonfree \
--disable-yasm \
--extra-cflags=" -fPIC -DANDROID -I$LOCAL/include " \
--extra-ldflags="-L$LOCAL/lib " \
--logfile=$(pwd)/../build/config.log \
--prefix=$LOCAL

make clean
make 
make install 
make clean

cd ../build

編譯參照:

http://blog.csdn.net/najiutan/article/details/43762759

http://www.cnblogs.com/haibindev/archive/2011/12/01/2270126.html


android平臺下ffmpeg編譯: