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里面打开对应的开关,
这里编译的时候就有一个目录问题需要注意的把!