centos 安装 ffmpeg

centos 安装ffmpeg

1 下载ffmpeg 安装包

下载 ffmpeg-4.1.tar.xz

https://johnvansickle.com/ffmpeg/release-source/

2 解压

tar xvJf ffmpeg-4.1.tar.xz



3、安装gcc和yasm编译器

sudo yum install gcc

sudo yum install yasm


4、指定安装目录/usr/local/ffmpeg

./configure --enable-shared --prefix=/usr/local/ffmpeg



4.2 如果上步有错误:

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

解决:

①wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz  #下载源码包

②tar zxvf yasm-1.3.0.tar.gz #解压

③cd yasm-1.3.0 #进入目录 
④./configure #配置 
⑤make && make install #编译安装


5 执行 make (非常久)

make

6 执行 make install (安装)

make install

7.修改文件/etc/ld.so.conf

1 vim /etc/ld.so.conf
1 输入以下内容
    include ld.so.conf.d/*.conf
    /usr/local/ffmpeg/lib/

8.使修改的文件/etc/ld.so.conf生效

ldconfig

9 查看版本

./ffmpeg -version

10、配置环境变量

vim ~/.bashrc

export PATH=$PATH:/usr/local/ffmpeg/bin

11、使环境变量生效

source ~/.bashrc

12、查看ffmpeg版本

ffmpeg -version

上一篇:Makefile教程


下一篇:RocketMQ 端云一体化设计与实践