1.ffmpeg源碼不包含一些格式的編碼器,只是提供了接口,需要自己下載編譯第三方庫,下載了幾種經常用到的:
LAME 下載地址 mp3編碼器
libvo_aacenc 下載地址 AAC編碼器
libxvidcore 下載地址 xvid編碼器
libx264 下載地址 h264編碼器
2.第三方庫的編譯
許多庫的configure文件都不能識別msys2編譯環境,所以最好手動指定
摘錄自http://blog.chinaunix.net/uid-20634420-id-3027812.html
--build= 誰在這里編譯? 意思說你目前的編譯動作在哪里跑的 ? 如果是編譯一個arm工具鏈,雖然工具鏈為為arm弄的,但是構建工具鏈的時候是在主機上進行的。所以 --build=i686-pc-linux-gnu
--host= 目前編譯出來的程序在哪里跑 ? 所以工具鏈好了之后,給目標系統編譯程序全部是設置host為arm的。
--target=為誰編譯程序,這在交叉編譯的時候跟host一個意思,一般是guess的,而且configure 腳本會說是 =--host.
lame:
./configure --build=mingw32 --host=i686-w64-mingw32 make make install
lame對於gcc版本在4.9.0以上,32位系統在xmm_quantize_sub.c
會有編譯錯誤,官方給出的修復辦法是
sed -i -e '/xmmintrin\.h/d' configure
libx264:
./configure --host=i686-w64-mingw32 --enable-static make make install
libvo-aacenc:
./configure --build=mingw32 --host=i686-w64-mingw32 make make install
libxvidcore:
./configure --build=mingw32 --host=i686-w64-mingw32 make make install
至此第三方庫都被安裝到了/usr/local目錄下
64位的mingw64把host改為x86_64-w64-mingw32
(未完待續)