Ubuntu18.04安装编译ffmpeg库

0、安装相关依赖库

sudo apt-get update && sudo apt-get -y install \
  autoconf \
  automake \
  build-essential \
  cmake \
  git-core \
  libass-dev \
  libfreetype6-dev \
  libgnutls28-dev \
  libmp3lame-dev \
  libsdl2-dev \
  libtool \
  libva-dev \
  libvdpau-dev \
  libvorbis-dev \
  libxcb1-dev \
  libxcb-shm0-dev \
  libxcb-xfixes0-dev \
  meson \
  ninja-build \
  pkg-config \
  texinfo \
  wget \
  yasm \
  zlib1g-dev \
  libunistring-dev
 

1、下载FFmpeg压缩包并解压

Download FFmpeg

2、安装ffmpeg库

在cd到ffmpeg的文件夹下,执行以下命令,配置安装路径:

./configure --prefix=/home/petal/Downloads/ffmpeg_install

安装:

 make && make install

3、配置环境

修改 /etc/profile文件:

sudo vim /etc/profile

最后一行添加路径:

export PATH=/home/petal/Downloads/ffmpeg_install/bin/:$PATH

保存后source:

source /etc/profile

修改 /etc/ld.so.conf:

sudo vim /etc/ld.so.conf

添加:

include /home/petal/Downloads/ffmpeg_install/lib

执行:

sudo ldconfig

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