所需软件
准备
复制代码
1
2
3
4
5yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel -y
复制代码
1
复制代码
1新版还加了下面的
复制代码
1
2cmake freetype-devel mercurial
复制代码
1
编译yasm
tar -zxvf yasm-1.2.0.tar.gz
复制代码
1cd yasm-1.2.0 ./configure --prefix=/usr/local
复制代码
1make && make install
复制代码
1
2
3
4. ~ /.bash_profile
编译fdk_aac
tar -zxvf fdk-aac-0.1.1.tar.gz
复制代码
1
cd fdk-aac-0.1.1
autoreconf
-fiv
.
/
configure
--prefix
=
/
usr
/
local
复制代码
1
2
3make && make install
编译x264
复制代码
1
2cd x264 //如果之前安装过FFmpeg,会自动链接lavf,如果不想链接lavf,可添加--disable-lavf ./configure --prefix=/usr/local --enable-static --enable-shared
复制代码
1make && make install
编译FFmpeg
复制代码
1cd ffmpeg
复制代码
1PKG_CONFIG_PATH=/usr/local/lib/pkgconfig export PKG_CONFIG_PATH 或把上面2行加到vim ~/.bash_profile
source ~/.bash_profile
echo $PKG_CONFIG_PATH
复制代码
1hash -r . ~/.bash_profile
接着输入ffmpeg检查是否安装成功,
如果出现如下错误:
error while loading shared libraries: libavdevice.so.54
解决方法:
复制代码
1
2vim /etc/ld.so.conf 添加 /usr/local/lib /usr/local/lib64 后 # ldconfig
艺搜参考
http://trac.ffmpeg.org/wiki/CompilationGuide/Centos
最后
以上就是温柔外套最近收集整理的关于centos 在CentOS下编译FFmpeg的全部内容,更多相关centos内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复