一.下载ffmpeg源码
http://www.ffmpeg.org/releases
二.进入解压目录后,输入如下命令配置为自己安装的目录
cd xxxx.tar.gz
./configure --prefix=/usr/local/ffmpeg
make
make install
三.安装问题
如果安装ffmpeg过程中,执行./configure时,报yasm/nasm not found or too old. Use --disable-yasm for a crippledbuild错误,
nasm/yasm not found or too old. Use --disable-x86asm for a crippled build.
If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
分析、解决如下:
分析:yasm是汇编编译器,ffmpeg为了提高效率使用了汇编指令,如MMX和SSE等。所以系统中未安装yasm时,就会报上面错误。
解决:安装yasm编译器。安装方法如下:
在http://www.tortall.net/projects/yasm/releases下面找到适合自己平台的yasm版本。然后进行安装。举例如下:
1.下载:wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
2.解压:tar zxvf yasm-1.3.0.tar.gz
3.切换路径: cd yasm-1.3.0
4.执行配置: ./configure
5.编译:make
6.安装:make install
安装yasm同样需要配置环境变量:
vim ~/.bashrc
在最后PATH添加环境变量:
export PATH=$PATH:/usr/local/yasm/bin
保存退出
查看是否生效
source ~/.bashrc 设置生效
四.配置环境
设置环境变量
vim ~/.bashrc
export PATH=$PATH:/usr/local/ffmpeg/bin
source ~/.bashrc