Ubuntu18.04 installs and compiles ffmpeg library

0. Install related dependent libraries

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. Download the FFmpeg compressed package and decompress it

Download FFmpeg

2. Install the ffmpeg library

In the cd folder to ffmpeg, execute the following command to configure the installation path:

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

Install:

 make && make install

3. Configure the environment

Modify the /etc/profile file:

sudo vim /etc/profile

The last line adds the path:

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

After saving source:

source /etc/profile

Modify /etc/ld.so.conf:

sudo vim /etc/ld.so.conf

Add to:

include /home/petal/Downloads/ffmpeg_install/lib

implement:

sudo ldconfig

Guess you like

Origin blog.csdn.net/qq_44189622/article/details/132454379
Recommended