ubuntu12.4系統
1 下載ffmpeg
git clone git://source.ffmpeg.org/ffmpeg.git
我下載的版本是:version 0.11
2/編譯選項
什麼是編譯配置選項呢?其實就是一些宏開關
#if
#else
#endif
代碼根據不同的開關,執行不同的代碼段。
提供給編譯者的配置開關
./confiure --help
就可以看到
主要分類如下:
Help options: //幫助選項
Standard options://標準選項,就是一些編譯配置項。
Licensing options://授權選項
Configuration options://配置選項
Component options: //組件選項
Individual component options: 個體的組件選項
External library support://外部庫支持
Advanced options (experts only)://高級選項
Optimization options (experts only)://優化選項
Developer options (useful when working on FFmpeg itself)://開發選項
我編譯x86的話,編譯一個ffmpeg的版本來用一下。一般使用的選項
Licensing options:
--enable-version3
--enable-gpl
--disable-nonfree
Configuration options:
--enable-shared
Component options:
--disable-doc
--disable-ffplay
--disable-ffserver
--disable-ffprobe
--disable-devices
--disable-protocols
--disable-debug
Individual component options:
--enable-protocol=file
--enable-parsers
--enable-decoders
--enable-demuxers
External library support://沒有都不打開
Advanced options (experts only):
-arch=i686
要是我用默認配置:
forx86的簡易配置
#./configure--prefix=./install--arch=i686--enable-gpl
--disable-shared --enable-pthreads
#make
#make install
試試看了!
yasm not found, asm的編譯器沒有找到,安裝看了。
#sudo apt-get install yasm
成功:
Creating config.mak and config.h...
#make
開始編譯 ,成功。
#make install
hdhuang@hdh-UBT:~/Android/git/ffmpeg$ ./ffmpeg
ffmpeg version N-41018-g65e6307 Copyright (c) 2000-2012 the FFmpeg developers
built on May 25 2012 10:54:29 with gcc 4.6.3
configuration: --prefix=./install --arch=i686 --enable-gpl --disable-shared
libavutil 51. 54.100 / 51. 54.100
libavcodec 54. 23.100 / 54. 23.100
libavformat 54. 6.100 / 54. 6.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 77.100 / 2. 77.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
就成功了,就那麼easy,so easy。
看了看怎麼沒有ffplay呢?查看config.h CONFIG_FFPLAY=0
編譯選項沒有打開。
ffplay依賴SDL庫,估計是我沒有安裝SDL庫。
sudo apt-get install libsdl1.2-dev
重新生成,就好了。
那麼有個問題了,ffmpeg的第三方依賴庫,如faad lame 等如何加入到ffmpeg的鏈接裏面的。
A/下載開源庫。
B 編譯
C 打開在ffmpeg裏面打開對應的開關,
這裏編譯的時候就有一個目錄問題需要注意的把!