ffmpeg 源码安装

593 阅读1分钟

cmake源码安装(没有cmake环境时需要此步)

  1. 解压 cmake包
tar zxf cmake-3.5.0
  1. 进入 解压后的包中, 编译并安装
./bootstrap --prefix=/usr/local/cmake
cd cmake-3.5.0
make
make install
  1. 在 /etc/profile 末尾添加环境变量
PATH=/usr/local/cmake/bin:$PATH
export PATH
  1. check
cmake --version

ffmpeg

  1. 解压 ffmpeg 包
tar zxf ffmpeg-3.1
  1. 进入ffmpeg 解压后的包
./configure --prefix=/usr/local/ffmpeg
make && make install
  1. 在 /etc/profile 末尾添加环境变量
PATH=/usr/local/ffmpeg/bin:$PATH
  1. check
ffmpeg --version

当执行第二步命令中出现以下错误, 需要安装 yasm

yasm/nasm not found or too old. Use –disable-yasm for a crippled build.
  1. 安装步骤
将 yasm tar包导入到在ffmpeg中, 解压, 编译安装
tar zxf yasm-1.3.0
cd yasm
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
make && make install

参考
www.cnblogs.com/miaosha5s/p…
hacpai.com/article/145…