1、下载ffmpeg
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
2、进入目录
cd ffmpeg
3、运行安装
./configure --enable-shared --prefix=/monchickey/ffmpeg
提示出错:
yasm/nasm not found or too old. Use --disable-yasm for a crippled build
或者
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
4、按照提示需要安装yasm
使用如下
yum install yasm
5、make
6、make install
7、测试是否成功,执行ffmpeg -version
提示出错:
-bash: ffmpeg: command not found
或者
ffmpeg: error while loading shared libraries: libavfilter.so.7: cannot open shared object file: No such file or directory
8.动态链接库 vi /etc/ld.so.conf
加入:/usr/local/ffmpeg/lib
执行ldconfig
9.为Ffmpeg加入环境变量vi /etc/profile
加入以下内容:FFMPEG=/usr/local/ffmpeg
PATH加入:$FFMPEG/bin
10.使修改立即生效source /etc/profile
如果依旧不行 ,则你安装的方式可能是编译安装,也就是在安装成功后又自动生成编译文件,那么第8步需要你填写编译后的地址
先查找该命令文件的地址find / -name libavdevice.so.56 得到该文件的目录地址,写这个地址