在ubuntu apt get ffmpeg失效的情况下怎么安装ffmpeg

方法1: git clone 下载

  1. 安装缺少的库文件
sudo apt-get update
sudo apt-get install -y ffmpeg libavresample-dev
  1. 克隆ffmpeg
git clone https://github.com/FFmpeg/FFmpeg.git
  1. 安装依赖项
sudo apt-get update

sudo apt-get -y install build-essential checkinstall cmake git libasound2-dev libass-dev libavcodec-dev libavformat-dev libavutil-dev libfreetype6-dev libgnutls28-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libopus-dev librtmp-dev libsdl2-dev libtool libvorbis-dev libx264-dev libx265-dev libxcb-shape0-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texinfo wget yasm zlib1g-dev
  1. 编译和安装ffmpeg
cd FFmpeg
./configure --enable-shared --disable-static --enable-gpl --enable-libass --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-librtmp --enable-libvorbis --enable-libx264 --enable-libx265 --enable-nonfree
make -j$(nproc)
sudo checkinstall --pkgversion=7:4.4 --pkgname=ffmpeg --backup=no --deldoc=yes --fstrans=no --default

方法2: wget(推荐)

  1. 下载
wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz

  1. 解压
tar -xf ffmpeg-release-amd64-static.tar.xz

  1. Copy the ffmpeg binary to the /usr/local/bin directory:
sudo cp ffmpeg*/ffmpeg /usr/local/bin/

ffmpeg -version

你可能感兴趣的:(小工具,ffmpeg,ubuntu,linux)