centos7 安装ffmpeg 完整版

广告位

一.安装环境依赖 yum install autoconf automake bzip2 bzip2-deve…

一.安装环境依赖

yum install autoconf automake bzip2 bzip2-devel cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel

mkdir  /ur/local/ffmpeg

二。安装nasm

cd /usr/local/ffmpeg
curl -O -L 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
./configure --prefix="/usr/loca/ffmpeg_build" --bindir="/usr/loca/bin"
make
make install

三。安装yasm

cd /usr/local/ffmpeg
curl -O -L 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="/usr/local/ffmpeg_build" --bindir="/usr/local/bin"
make
make install

四。安装libx264

cd /usr/local/ffmpeg
git clone --depth 1 https://code.videolan.org/videolan/x264.git
cd x264
PKG_CONFIG_PATH="/usr/local/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/usr/local/ffmpeg_build" --bindir="/usr/local/bin" --enable-static --disable-asm
make
make install

五。安装libx265

cd /usr/local/ffmpeg
hg clone https://bitbucket.org/multicoreware/x265
cd /usr/local/ffmpeg/x265/build/linux
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="/usr/local/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source
make
make install

六。安装libfdk_aac

cd /usr/local/ffmpeg
git clone --depth 1 https://github.com/mstorsjo/fdk-aac
cd fdk-aac
autoreconf -fiv
./configure --prefix="/usr/local/ffmpeg_build" --disable-shared
make
make install

七。安装libmp3lame

cd /usr/local/ffmpeg
curl -O -L https://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz
tar xzvf lame-3.100.tar.gz
cd lame-3.100
./configure --prefix="/usr/local/ffmpeg_build" --bindir="/usr/local/bin" --disable-shared --enable-nasm
make
make install

八。安装libopus

cd /usr/local/ffmpeg
curl -O -L https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz
tar xzvf opus-1.3.1.tar.gz
cd opus-1.3.1
./configure --prefix="/usr/local/ffmpeg_build" --disable-shared
make
make install

九。安装libvpx

cd /usr/local/ffmpeg
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
cd libvpx
./configure --prefix="/usr/local/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm
make
make install

十,编译ffmpeg

cd /usr/local/ffmpeg
curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xjvf ffmpeg-snapshot.tar.bz2
cd ffmpeg
PATH="/usr/local/bin:$PATH" PKG_CONFIG_PATH="/usr/local/ffmpeg_build/lib/pkgconfig" ./configure \
  --prefix="/usr/local/ffmpeg_build" \
  --pkg-config-flags="--static" \
  --extra-cflags="-I/usr/local/ffmpeg_build/include" \
  --extra-ldflags="-L/usr/local/ffmpeg_build/lib" \
  --extra-libs=-lpthread \
  --extra-libs=-lm \
  --bindir="/usr/local/bin" \
  --enable-gpl \
  --enable-libfdk_aac \
  --enable-libfreetype \
  --enable-libmp3lame \
  --enable-libopus \
  --enable-libvpx \
  --enable-libx264 \
  --enable-libx265 \
  --enable-nonfree
make
make install
hash -d ffmpeg

至此,安装完成

运行 ffmpeg 查看版本。

关于作者: 蘇小曉

为您推荐

广告位

发表评论

电子邮件地址不会被公开。 必填项已用*标注