ubuntu1604
sudo apt-get update
所需组件
sudo apt-get -y install
autoconf
automake
build-essential
cmake
git-core
libass-dev
libfreetype6-dev
libsdl2-dev
libtool
libva-dev
libvdpau-dev
libvorbis-dev
libxcb1-dev
libxcb-shm0-dev
libxcb-xfixes0-dev
pkg-config
texinfo
wget
zlib1g-dev
NASM
wget https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2
tar xjvf nasm-2.14.02.tar.bz2
cd nasm-2.14.02
./autogen.sh
PATH="PATH" ./configure --prefix="HOME/bin"
make && make install
YASM
wget -O yasm-1.3.0.tar.gz https://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar xzvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure --prefix="HOME/bin"
make && make install
libx264
https://github.com/mirror/x264
PATH="PATH" PKG_CONFIG_PATH="HOME/ffmpeg_build" --bindir="HOME/bin:$PATH" make && make install
libx265
https://github.com/videolan/x265
cd build/linux/
PATH="PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="HOME/bin:$PATH" make && make install
libvpx
https://github.com/webmproject/libvpx.git
cd libvpx
PATH="PATH" ./configure --prefix="HOME/bin:$PATH" make && make install
libfdk-aac
git clone --depth 1 https://github.com/mstorsjo/fdk-aac
cd fdk-aac
autoreconf -fiv &&
./configure CFLAGS=-fPIC --prefix="$HOME/ffmpeg_build" &&
make && make install
libmp3lame
git clone --depth 1 https://gitee.com/hqiu/lame.git
PATH="PATH" ./configure --prefix="HOME/bin" --enable-nasm --with-pic &&
PATH="PATH" make && make install
libopus
git clone --depth 1 https://github.com/xiph/opus.git
./autogen.sh &&
./configure --prefix="$HOME/ffmpeg_build" -with-pic&&
make && make install
ffmpeg
wget -O ffmpeg-4.2.1.tar.bz2 https://ffmpeg.org/releases/ffmpeg-4.2.1.tar.bz2
tar xjvf ffmpeg-4.2.1.tar.bz2
cd ffmpeg-4.2.1
PATH="PATH" PKG_CONFIG_PATH="HOME/ffmpeg_build"
--pkg-config-flags="--static"
--extra-cflags="-IHOME/ffmpeg_build/lib"
--extra-libs="-lpthread -lm"
--bindir="HOME/bin:$PATH" make &&
make install &&
hash -r
执行
source ~/.profile
安装之后
bin目录下
ffmpeg_build目录下