centos 在CentOS下编译FFmpeg

所需软件

准备

yum install   autoconf  automake  gcc gcc-c++ git libtool make  nasm pkgconfig zlib-devel  -y
新版还加了下面的
cmake freetype-devel  mercurial 

编译yasm

tar -zxvf yasm-1.2.0.tar.gz 
cd yasm-1.2.0 ./configure --prefix=/usr/local
make && make install
    
    
     
     . ~
     
     /.bash_profile
    
    

编译fdk_aac

tar -zxvf fdk-aac-0.1.1.tar.gz 
 
   
cd fdk-aac-0.1.1
autoreconf -fiv . / configure --prefix = / usr / local
make &&  make  install

编译x264

cd x264 //如果之前安装过FFmpeg,会自动链接lavf,如果不想链接lavf,可添加--disable-lavf ./configure --prefix=/usr/local --enable-static  --enable-shared
make  && make install

编译FFmpeg

cd ffmpeg
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig export PKG_CONFIG_PATH 或把上面2行加到vim ~/.bash_profile
source ~/.bash_profile
 echo $PKG_CONFIG_PATH
. /configure --prefix= /usr / local --extra-cflags=-I /usr /local /include \ --extra-ldflags=-L /usr /local /lib --bindir= /usr /local /bin \ --extra-libs= "-ldl" --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libx264 --enable-shared   make && make install
hash -r . ~/.bash_profile

接着输入ffmpeg检查是否安装成功,

如果出现如下错误:

error while loading shared libraries: libavdevice.so.54

解决方法:

vim  /etc/ld.so.conf 添加 /usr/local/lib /usr/local/lib64 后 # ldconfig

艺搜参考

http://trac.ffmpeg.org/wiki/CompilationGuide/Centos

转载于:https://www.cnblogs.com/elesos/p/6867917.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值