FFmpeg 学习之 centos 下编译配置

参考此文:http://blog.csdn.net/yy3097/article/details/51073445


1.下载文件

下载网址:http://www.ffmpeg.org/download.html

新建文件夹,提取至此处,便可解压。


2.编辑profile文件

 gedit  /etc/profile
 在文件末尾加上两句话:
 export FFMPEG_HOME=/usr/local/ffmpeg 
 export PATH=$FFMPEG_HOME/bin:$PATH
 执行 source etc/profile
 输出变量 echo $FFMPEG_HOME

3.安装encode库

1)先下载x264的工程代码,h264 的编码库下载地址(git clone git://git.videolan.org/x264.git)

2)进入x264文件夹,执行./configure –enable-shared –enable-static
3)完了make && make install就可以了。


4.配置安装

进入ffmpeg目录,执行 ./configure --enable-shared --prefix=/usr/local/ffmpeg

--enable-shared 参数据说是允许其编译产生动态库,在以后的编程中要用到这个几个动态库。

再执行以下命令:

./configure --enable-shared --disable-yasm --disable-opencl --enable-gpl --enable-libx264 --prefix=/usr/local/ffmpeg


5.编译安装

make
make install

修改/etc/ld.so.conf 在最后一行加上/usr/local/ffmpeg/lib
ldconfig -v


6.测试

ffmpeg -version











猜你喜欢

转载自blog.csdn.net/u010477528/article/details/78087944