安装方法一:直接下载ffmpeg静态库(推荐)
ffmpeg_static下载完解压后,可看到在
bin
文件夹中,有3个可执行文件:ffmpeg
ffplay
ffprobe
将这3个文件直接移动到
/usr/local/bin
下,便可直接在终端使用了。
下载官方提供的静态库,默认带了很多编码器,很方便。
下面是官方静态库4.1.4版本配置文件:
Configuration:
--enable-gpl
--enable-version3
--enable-sdl2
--enable-fontconfig
--enable-gnutls
--enable-iconv
--enable-libass
--enable-libbluray
--enable-libfreetype
--enable-libmp3lame
--enable-libopencore-amrnb
--enable-libopencore-amrwb
--enable-libopenjpeg
--enable-libopus
--enable-libshine
--enable-libsnappy
--enable-libsoxr
--enable-libtheora
--enable-libtwolame
--enable-libvpx
--enable-libwavpack
--enable-libwebp
--enable-libx264
--enable-libx265
--enable-libxml2
--enable-libzimg
--enable-lzma
--enable-zlib
--enable-gmp
--enable-libvidstab
--enable-libvorbis
--enable-libvo-amrwbenc
--enable-libmysofa
--enable-libspeex
--enable-libxvid
--enable-libaom
--enable-appkit
--enable-avfoundation
--enable-coreimage
--enable-audiotoolbox
Libraries:
SDL 2.0.9 <https://libsdl.org>
Fontconfig 2.13.0 <http://freedesktop.org/wiki/Software/fontconfig>
GnuTLS 3.6.8 <https://gnutls.org/>
libiconv 1.15 <http://gnu.org/software/libiconv>
libass 0.14.0 <https://github.com/libass/libass>
libbluray 20180913-2d18c70 <https://www.videolan.org/developers/libbluray.html>
FreeType 2.10.1 <http://freetype.sourceforge.net>
LAME 3.100 <http://lame.sourceforge.net>
OpenCORE AMR 20170731-07a5be4 <https://sourceforge.net/projects/opencore-amr>
OpenJPEG 20190615-8db9d25 <https://github.com/uclouvain/openjpeg>
Opus 20190604-ad8fe90 <https://opus-codec.org>
shine 3.1.1 <https://github.com/savonet/shine>
Snappy 1.1.7 <https://github.com/google/snappy>
libsoxr 20180224-945b592 <http://sourceforge.net/projects/soxr>
Theora 20171023-e5d205b <http://theora.org>
TwoLAME 0.3.13 <http://twolame.org>
vpx 20190715-d749bc7 <http://webmproject.org>
WavPack 5.1.0 <http://wavpack.com>
WebP 1.0.3 <https://developers.google.com/speed/webp>
x264 20190314-5493be8 <https://www.videolan.org/developers/x264.html>
x265 20190708-147fb92 <https://bitbucket.org/multicoreware/x265/wiki/Home>
libxml2 2.9.8 <http://xmlsoft.org>
z.lib 20190712-e655cd4 <https://github.com/sekrit-twc/zimg>
XZ Utils 5.2.4 <http://tukaani.org/xz>
zlib 1.2.11 <http://zlib.net>
vid.stab 20190213-aeabc8d <http://public.hronopik.de/vid.stab>
Vorbis 20180705-46e70fa <http://vorbis.com>
VisualOn AMR-WB 20141107-3b3fcd0 <https://sourceforge.net/projects/opencore-amr>
libmysofa 20181220-50ee637 <https://github.com/hoene/libmysofa>
Speex 20181021-6e04bfa <http://speex.org>
Xvid 1.3.5 <https://labs.xvid.com>
aom 20190716-c41e3e1 <https://aomedia.googlesource.com/aom>
安装方法二:手动编译
在官网下载源代码:https://ffmpeg.org/download.html
大大的下载按钮,点击下载。
比如:ffmpeg-4.1.4.tar.bz2
-
解压
$ tar xvf ffmpeg-4.1.4.tar.bz2
-
编译
终端进入ffmpeg-4.1.4文件夹后执行
$ ./configure
$ make && make install
直接使用
./configure
,安装完成后,缺少一些额外的编码器,如:libmp3lame
等
-
错误处理
在运行 ./configure 时,出现ffmpeg yasm not found, use --disable-yasm for a crippled build
的错误 -
解决方法:手动安装yasm
在这里下载最新版本的yasm:http://www.tortall.net/projects/yasm/releases
然后解压,编译安装。
网友评论