多媒体视频处理工具FFmpeg有非常强大的功能包括视频采集功能、视频格式转换、视频抓图、给视频加水印等。很多剪辑软件的后台都是使用ffmpeg来处理数据!

ffmpeg官网

liunx下载安装


wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2

#解压
tar   -jxvf ffmpeg-snapshot.tar.bz2

#进入目录
cd ffmpeg

编译安装

./configure --enable-shared --prefix=/usr/local/ffmpeg && make && make install
如果报错
[root@iZj6c4ty14huv1ncu5e9axZ ffmpeg]# ./configure --enable-shared --prefix=/usr/local/ffmpeg && make && make install
nasm/yasm not found or too old. Use --disable-x86asm 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 "ffbuild/config.log" produced by configure as this will help
solve the problem.

那就这样安装

./configure --enable-shared --disable-x86asm --prefix=/usr/local/ffmpeg && make && make install

添加软链

cp /usr/local/ffmpeg/bin/ffmpeg /usr/local/bin/ffmpeg

安装完成之后 执行 ffmpeg -version

如果能够出现类似下列信息,说明ffmpeg安装成功。

[root@iZbp153yczpm4pp9pjs0u3Z local]# ffmpeg -version
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-36)
configuration: --enable-shared --disable-yasm --prefix=/usr/local/ffmpeg
libavutil      56. 14.100 / 56. 14.100
libavcodec     58. 18.100 / 58. 18.100
libavformat    58. 12.100 / 58. 12.100
libavdevice    58.  3.100 / 58.  3.100
libavfilter     7. 16.100 /  7. 16.100
libswscale      5.  1.100 /  5.  1.100
libswresample   3.  1.100 /  3.  1.100

如果报错 libavdevice.so.57: cannot open shared object file: No such file or directory
执行命令: vim /etc/ld.so.conf.d/ffmpeg.conf 然后添加一行内容: /usr/local/ffmpeg/lib 之后保存并退出,然后执行 ldconfig 使配置生效,现在再次执行 ffmpeg -version 显示就正常了

windows下载安装

https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z

解压到 D://ffmpeg 下面

添加环境变量

安装成功

Last modification:November 5th, 2020 at 11:00 am
如果觉得我的文章对你有用,请随意赞赏