ffmpeg源码安装
官网下载地址
http://www.ffmpeg.org/download.html
https://sourceforge.net/projects/opencore-amr/
参考资料:官网及以下网站
http://blog.csdn.net/5iasp/article/details/50913855
http://blog.csdn.net/zhangwu1241/article/details/52354604
http://www.cnblogs.com/wanghetao/p/3386311.html
http://www.cnblogs.com/bugutian/p/5111067.html
http://www.linuxidc.com/Linux/2013-01/78495.htm
——————————————华丽的分割线—————————————————————————
部署环境:CentOS 6.8
百度安装包分享:http://pan.baidu.com/s/1pLDlNSZ 密码:egsw
安装记录
yum install -y autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel
mkdir /software
tar -zxvf ffmpeg_sources.tar.gz -C /software
tar -zxvf nasm-2.13.02rc2.tar.gz -C /software
cd /software/nasm-2.13.02rc2
./configure --prefix="/software/nasm"
make
make install
修改环境变量vim /etc/profile
加入export PATH=/software/nasm/bin:/software/ffmpeg_build/bin:$PATH
然后source /etc/profile
cd /software/ffmpeg_sources/yasm
autoreconf -fiv
./configure --prefix="/software/ffmpeg_build" --bindir="/software/ffmpeg_build/bin"
make && make install
cd /software/ffmpeg_sources/x264
#PKG_CONFIG_PATH="/software/ffmpeg_build/lib/pkgconfig" ./configure --prefix=/software/ffmpeg_build --bindir=/software/ffmpeg_build/bin --enable-static
PKG_CONFIG_PATH="/software/ffmpeg_build/lib/pkgconfig" ./configure --prefix=/software/ffmpeg_build --bindir=/software/ffmpeg_build/bin --enable-static --disable-asm
make && make install
cd /software/ffmpeg_sources/x265/build/linux
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="/software/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source
make && make install
cd /software/ffmpeg_sources/fdk-aac
autoreconf -fiv
./configure --prefix="/software/ffmpeg_build" --disable-shared
make && make install
cd /software/ffmpeg_sources/lame-3.99.5
./configure --prefix="/software/ffmpeg_build" --bindir="/software/ffmpeg_build/bin" --disable-shared --enable-nasm
make && make install
cd /software/ffmpeg_sources/opus
autoreconf -fiv
./configure --prefix="/software/ffmpeg_build" --disable-shared
make && make install
cd /software/ffmpeg_sources/libogg-1.3.2
./configure --prefix="/software/ffmpeg_build" --disable-shared
make && make install
make distclean
cd /software/ffmpeg_sources/libvorbis-1.3.4
LDFLAGS="-L/software/ffmeg_build/lib" CPPFLAGS="-I/software/ffmpeg_build/include" ./configure --prefix=/software/ffmpeg_build --with-ogg=/software/ffmpeg_build --disable-shared
此时如果有如下报错
checking for OGG... no
checking for Ogg... no
*** Could not run Ogg test program, checking why...
*** The test program compiled, but did not run. This usually means
*** that the run-time linker is not finding Ogg or finding the wrong
*** version of Ogg. If it is not finding Ogg, you'll need to set your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the installed location Also, make sure you have run ldconfig if that
*** is required on your system
***
*** If you have an old version installed, it is best to remove it, although
*** you may also be able to get things to work by modifying LD_LIBRARY_PATH
configure: error: must have Ogg installed!
我们上面已经安装过libogg了,此时这个提示没有安装,可能是路径问题
解决方案,创建库文件
[root@restapi_1 libvorbis-1.3.4]# cat /etc/ld.so.conf.d/local-libraries.conf
/software/ffmpeg_build/lib
[root@restapi_1 libvorbis-1.3.4]# ldconfig -v
此时解决了库依赖问题,在次跑编译安装,没有报错了
LDFLAGS="-L/software/ffmeg_build/lib" CPPFLAGS="-I/software/ffmpeg_build/include" ./configure --prefix=/software/ffmpeg_build --with-ogg=/software/ffmpeg_build
make && make install
cd /software/ffmpeg_sources/libvpx
./configure --prefix="/software/ffmpeg_build" --enable-pic --enable-shared
make && make install
cd /software/ffmpeg_sources/ffmpeg3
PKG_CONFIG_PATH="/software/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/software/ffmpeg_build" --extra-cflags="-I/software/ffmpeg_build/include" --extra-ldflags="-L/software/ffmpeg_build/lib" --bindir="/software/ffmpeg_build/bin" --pkg-config-flags="--static" --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-pic --enable-shared --enable-gray --enable-avresample --enable-openssl
此时如果有编译报错,如下
/usr/bin/ld: /software/ffmpeg_build/lib/libx264.a(common.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/ffmpeg_build/lib/libx264.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libavcodec/libavcodec.so.57] Error 1
解决方法是:
config.mak L75加入 -fPIC,然后重新编译
HOSTCFLAGS=-O3 -g -std=c99 -Wall -fPIC
我比较着急,直接去掉最后几个参数(询问开发,说不用这些模块),开始搞
PKG_CONFIG_PATH="/software/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/software/ffmpeg_build" --extra-cflags="-I/software/ffmpeg_build/include" --extra-ldflags="-L/software/ffmpeg_build/lib" --bindir="/software/ffmpeg_build/bin" --pkg-config-flags="--static" --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265
然后不报错了,make && make install
安装完成后启动报错,发现是没有文件库
ffmpeg: error while loading shared libraries: libvpx.so.4: cannot open shared object file: No such file or directory
进入相关库查看
[root@zookeeper_rest-api-node1 ffmpeg3]# cd /usr/lib64
ls -l 查看后发现没有,于是从安装目录/software/ffmpeg_build/lib/libvpx.so.4找到这个文件,并做好软链接
[root@zookeeper_rest-api-node2 lib64]# ln -s /software/ffmpeg_build/lib/libvpx.so.4 /usr/lib64/libvpx.so.4
[root@iZ2zehjeved0zzfkdndbc5Z ffmpeg3]# ffmpeg -v
ffmpeg: error while loading shared libraries: libvpx.so.4: cannot open shared object file: No such file or directory
[root@iZ2zehjeved0zzfkdndbc5Z ffmpeg3]# ln -s /software/ffmpeg_build/lib/libvpx.so.4 /usr/lib64/libvpx.so.4
[root@iZ2zehjeved0zzfkdndbc5Z ffmpeg3]# ffmpeg -v
ffmpeg: error while loading shared libraries: libvorbisenc.so.2: cannot open shared object file: No such file or directory
[root@iZ2zehjeved0zzfkdndbc5Z ffmpeg3]# ln -s /software/ffmpeg_build/lib/libvorbisenc.so.2 /usr/lib64/libvorbisenc.so.2
[root@iZ2zehjeved0zzfkdndbc5Z ffmpeg3]# ffmpeg -v
ffmpeg: error while loading shared libraries: libvorbis.so.0: cannot open shared object file: No such file or directory
[root@iZ2zehjeved0zzfkdndbc5Z ffmpeg3]# ln -s /software/ffmpeg_build/lib/libvorbis.so.0 /usr/lib64/libvorbis.so.0
此时解决了问题,ffmpeg -v后如下图所示,没有报错
ffmpeg源码安装的更多相关文章
- linux ffmpeg 源码安装教程
AMR格式是智能手机上的常用音频文件格式,比MP3格式的压缩比大.同样时长的AMR文件大概是MP3的十分之一,所以在移动互联项目中应用比较广泛.但目前AMR格式在个人电脑上应用较少,所以目前大部门播放 ...
- ffmpeg源码编译安装(Compile ffmpeg with source) Part 1 : 通用部分
本页内容包含了在Unix/Linux中用源码包编译的通用的结构 可能不仅仅适用于ffmpeg 为啥使用源码包编译 编译源码可以扩展功能, 实现相对于自己平台的最优化, 还可以自定义的修改 概述 大部分 ...
- Linux 源码安装 FFmpeg
加班次数频繁,已经快一年没有写博了.由于此次在项目中使用到了 FFmpeg 来处理音视频,顾记录下在 Linux 系统中源码安装 FFmpeg 以便不时之需. 1. 安装 yasm yasm 是一个汇 ...
- ffmpeg源码编译环境搭建
ffmpeg是视频开发最常用到的开源软件,FFmpeg功能强大,用途广泛,提供几乎所有你能够想到的与视频开发相关的操作,许多商业软件都以ffmpeg为基础进行开发定制. FFmpeg: FFmpeg ...
- 源码安装IVRE
简介:IVRE(又名DRUNK)是一款开源的网络侦查框架工具,IVRE使用Nmap.Zmap进行主动网络探测.使用Bro.P0f等进行网络流量被动分析,探测结果存入数据库中,方便数据的查询.分类汇总统 ...
- mono-3.4.0 源码安装时出现的问题 [do-install] Error 2 [install-pcl-targets] Error 1 解决方法
Mono 3.4修复了很多bug,继续加强稳定性和性能(其实Mono 3.2.8 已经很稳定,性能也很好了),但是从http://download.mono-project.com/sources/m ...
- 搭建LNAMP环境(七)- PHP7源码安装Memcached和Memcache拓展
上一篇:搭建LNAMP环境(六)- PHP7源码安装MongoDB和MongoDB拓展 一.安装Memcached 1.yum安装libevent事件触发管理器 yum -y install libe ...
- 搭建LNAMP环境(二)- 源码安装Nginx1.10
上一篇:搭建LNAMP环境(一)- 源码安装MySQL5.6 1.yum安装编译nginx需要的包 yum -y install pcre pcre-devel zlib zlib-devel ope ...
- 搭建LNAMP环境(一)- 源码安装MySQL5.6
1.yum安装编译mysql需要的包 yum -y install gcc-c++ make cmake bison-devel ncurses-devel perl 2.为mysql创建一个新的用户 ...
随机推荐
- Deep Learning - 1 神经网络
Artificial Neuron 人工神经元有: Perceptrons(感知机) Sigmoid Perceptron 感知机input是多个二进制,output是一个二进制. graph LR ...
- Android 设计模式对比
引言: Android框架的发展的过程就是一个不断化繁为简的过程,大家都在研究如何正确方便高效的规范代码.当然这条路也永远不会停止,就像新的芽儿,随着时间的流逝,每天都在长出新的枝叶,每天都在成长.对 ...
- Windows上通过bat调用jmx进行循环运行
1.jmx测试脚本中有两个线程组: 1)第一个线程组:模拟60台客户机并发像服务器发送上报请求,需要调用线程组的循环运行 2)第二个线程组:60台客户机上线后,模拟管理平台对客户机进行基础操作,如:创 ...
- 第二篇 Html(13章节)-a标签,img标签,列表,表格
1. a标签 - 超链接,可以跳转 - 锚 href='#某个标签的ID' 标签的ID不允许重复 <!DOCTYPE html> <html lang="en&qu ...
- [翻译]SQL Server等待事件—THREADPOOL
前言: 本文是对SQLSkills上一篇关于SQL Server中THREADPOOL等待的博客的翻译,本文也不是完全翻译,有些地方适当加入了自己的一些认知.如有翻译不对或不好的地方,敬请指出,大 ...
- 加密webconfig中的连接字符串,利用RSA非对称加密,利用windows保存密钥容器
简单的解决方法: WebConfig 加解密,未能使用提供程序“RsaProtectedConfigurationProvider”进行解密.提供程序返回错误消息为: 打不开 RSA 密钥容器.问题: ...
- cookie 和session 的区别(转)
二者的定义: 当你在浏览网站的时候,WEB 服务器会先送一小小资料放在你的计算机上,Cookie 会帮你在网站上所打的文字或是一些选择, 都纪录下来.当下次你再光临同一个网站,WEB 服务器会先看看有 ...
- [20180926]共享池中的NETWORK BUFFER.txt
[20180926]共享池中的NETWORK BUFFER.txt --//最近几天一直在探究SQL*Net more data from client 相关等待事件,发现SDU相关,自己也网上探究一 ...
- Django-404错误处理
404错误是用户输入错误的URL,在 URLconf 中匹配不到相应的URL而抛出的异常 如下图: 为了给用户提供一个友好的访问,需要配置404错误页面 1.在 templates 目录下新建 404 ...
- 洗礼灵魂,修炼python(89)-- 知识拾遗篇 —— 进程
进程 1.含义:计算机中的程序关于某数据集合上的一次运行活动,是系统进行资源分配和调度的基本单位.说白了就是一个程序的执行实例. 执行一个程序就是一个进程,比如你打开浏览器看到我的博客,浏览器本身是一 ...