Linux Centos 6.5 安装FFMPEG && 故障排查
2016-08-15 11:46
579 查看
首先在FFMEPG官网下载最新的FFMPEG的版本https://ffmpeg.org/download.html
下载的源码文件:ffmpeg-3.1.2.tar.bz2
上传至服务器之后进行解压操作:tar xvfj ffmpeg-3.1.2.tar.bz2
解压之后进入解压目录:
cd ffmpeg-3.1.2
编译安装:
./configure --enable-shared --prefix=/usr/local/ffmpeg
--enable-shared是允许其编译时产生动态库,在以后的开发过程中会用到这几个动态库
--prefix=/usr/local/ffmpeg 指定安装的路径
但是多数人在执行的时候会报如下错误:
yasm/nasm not found or too old. Use --disable-yasm 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 "config.log" produced by configure as this will help
solve the problem.这个错误说明服务器的yasm或者nasm版本过低过或者没有安装;
要解决这个问题很简单 安装对应的版本!
网站下载一个yasm,上传至服务器
如果yum库里面有yasm的话,直接执行yum install yasm
没有的话下载 http://yasm.tortall.net/Download.html
依次执行
tar xzvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure
make
make install
时间大约在两分钟左右
安装yasm之后在进行安装ffmpeg就不会报上述错误
依次执行
cd ffmpeg-3.1.2
./configure --enable-shared --prefix=/usr/local/ffmpeg (时间也可能略长 不超过5分钟)
make (时间可能会比较长 五分钟左右)
make install
没有出现错误的话说明ffmpeg正常安装了
/usr/local/ffmpeg/bin/ffmpeg --version
会出现如下错误:
/usr/local/ffmpeg/bin/ffmpeg: error while loading shared libraries: libavdevice.so.56: cannot open shared object file: No such file or directory原因是相应的库文件没有找到
解决办法:
修改文件/etc/ld.so.conf 内容增加/usr/local/ffmpeg/lib/
依次敲:
vi /etc/ld.so.conf
a (vim编辑器下的插入操作)
/usr/local/ffmpeg/lib/
ZZ
(保存退出)
为使修改生效
ldconfig
然后执行:/usr/local/ffmpeg/bin/ffmpeg -version
结果如下:
如上表示ffmpeg安装成功!
最后配置环境变量,使ffmpeg在如何目录下都可以执行
export PATH=/usr/local/ffmpeg/bin/:$PATH
env
如果想要使配置永久生效 :将配置写在profile中
vi /etc/profile
在尾部添加:export PATH=/usr/local/ffmpeg/bin/:$PATH
重启服务器即可!
运行测试代码:
ffmpeg -i 1.mp4 -b:v 640k output.ts
OK!
下载的源码文件:ffmpeg-3.1.2.tar.bz2
上传至服务器之后进行解压操作:tar xvfj ffmpeg-3.1.2.tar.bz2
解压之后进入解压目录:
cd ffmpeg-3.1.2
编译安装:
./configure --enable-shared --prefix=/usr/local/ffmpeg
--enable-shared是允许其编译时产生动态库,在以后的开发过程中会用到这几个动态库
--prefix=/usr/local/ffmpeg 指定安装的路径
但是多数人在执行的时候会报如下错误:
yasm/nasm not found or too old. Use --disable-yasm 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 "config.log" produced by configure as this will help
solve the problem.这个错误说明服务器的yasm或者nasm版本过低过或者没有安装;
要解决这个问题很简单 安装对应的版本!
网站下载一个yasm,上传至服务器
如果yum库里面有yasm的话,直接执行yum install yasm
没有的话下载 http://yasm.tortall.net/Download.html
依次执行
tar xzvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure
make
make install
时间大约在两分钟左右
安装yasm之后在进行安装ffmpeg就不会报上述错误
依次执行
cd ffmpeg-3.1.2
./configure --enable-shared --prefix=/usr/local/ffmpeg (时间也可能略长 不超过5分钟)
make (时间可能会比较长 五分钟左右)
make install
没有出现错误的话说明ffmpeg正常安装了
/usr/local/ffmpeg/bin/ffmpeg --version
会出现如下错误:
/usr/local/ffmpeg/bin/ffmpeg: error while loading shared libraries: libavdevice.so.56: cannot open shared object file: No such file or directory原因是相应的库文件没有找到
解决办法:
修改文件/etc/ld.so.conf 内容增加/usr/local/ffmpeg/lib/
依次敲:
vi /etc/ld.so.conf
a (vim编辑器下的插入操作)
/usr/local/ffmpeg/lib/
ZZ
(保存退出)
为使修改生效
ldconfig
然后执行:/usr/local/ffmpeg/bin/ffmpeg -version
结果如下:
如上表示ffmpeg安装成功!
最后配置环境变量,使ffmpeg在如何目录下都可以执行
export PATH=/usr/local/ffmpeg/bin/:$PATH
env
如果想要使配置永久生效 :将配置写在profile中
vi /etc/profile
在尾部添加:export PATH=/usr/local/ffmpeg/bin/:$PATH
重启服务器即可!
运行测试代码:
ffmpeg -i 1.mp4 -b:v 640k output.ts
OK!
相关文章推荐
- Linux Centos 6.5 安装FFMPEG && 故障排查
- linux centos6.5 R&RStudio Server安装/升级
- Centos6 编译安装ffmpeg & mplayer
- hadoop安装部署遇到问题,故障排查
- CentOS 6.5安装lvs+keepalive负载均衡+故障转移nginx
- Linux CentOS 6.5安装与配置JDK
- linux Centos 6.5 安装桌面环境GNOME
- 安装SqlServer2005时“版本变更检查 (警告)"问题排查
- Linux CentOS 6.5服务器上安装pip,requests库
- 深度定制CentOS 6.5安装光碟(替换内核&升级驱动)
- linux Centos 6.5 安装桌面环境GNOME
- Linux CentOS6.5 PHP memcache 扩展源码安装
- Windows Azure Services安装及故障排查
- centos6.5下面的qt安装于都家教网,于都人自己的家教网站<a garget="_blank" href="www.yudujiajiao.com">www.yudujiao.com</a>
- linux CentOS 6.5 中安装与配置JDK-7
- linux CentOS6.5 编译安装mysql-5.6.4
- SharePoint安装程序常见问题解答和故障排查指南,做个参考:)
- <车载物联网项目,视频采集传输部分,第一天> FFmpeg的安装过程
- Linux CentOS6.5 Sphinx 安装和使用(一)
- linux CentOS 6.5 中安装与配置JDK-7