Deep in Debian Linux install ffmpeg

Keywords: C++ sudo cmake git vim

Installing CMake and CCMake

sudo apt install cmake
sudo apt install cmake-curses-gui

Install X265 development library

sudo apt-get install libx265-dev

Install Yasm

Download address: http://www.tortall.net/projects/yasm/releases/
tar -xvf yasm-1.3.0.tar.gz
cd yasm-1.3.0/
./configure
make && make install

Install OpenCoreAMR

Download address: https://nchc.dl.sourceforge.net/project/opencore-amr/fdk-aac/fdk-aac-2.0.0.tar.gz
tar -xvf fdk-aac-2.0.0.tar.gz
cd fdk-aac-2.0.0/
./configure
make && make install

Install speex

Download address: https://ftp.osuosl.org/pub/xiph/releases/speex/speex-1.2.0.tar.gz
cd speex-1.2.0/
./configure
make && make install

Install lame

Download address: https://ayera.dl.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
tar -xvf lame-3.99.5.tar.gz
cd lame-3.99.5/
./configure
make && make install

Install nasm

sudo apt install nasm

Installing the X264 development library

Download address: http://www.videolan.org/developers/x264.html
tar -xvf last_x264.tar.bz2 
cd x264-snapshot-20190120-2245/
./configure --enable-shared
make && make install

Install X265 development library

Download address: http://ftp.videolan.org/pub/videolan/x265/
tar -xvf x265_2.9.tar.gz
cd x265_2.9/build/linux/
PATH="$HOME/bin:$PATH"
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source
make && make install

Install X11 development library

sudo apt-get install libx11-dev
sudo apt-get install xorg-dev

Install audio library

sudo apt-get install libasound2-dev

Refresh Library

sudo ldconfig

Install SDL development library

Download address: http://www.libsdl.org/hg.php
~$ tar -xvf SDL-2.0.9-12569.tar.gz
~$ cd SDL-2.0.9-12569/
~$ ./configure
~$ make && make install

Refresh Library

sudo ldconfig

Download ffmpeg

git clone https://git.ffmpeg.org/ffmpeg.git

To configure

./configure \
--prefix=/home/niko/Applications/ffmpeg \
--enable-gpl \
--enable-nonfree \
--enable-libfdk-aac \
--enable-libx264 \
--enable-libx265 \
--enable-filter=delogo \
--enable-debug \
--disable-optimizations \
--enable-libspeex \
--enable-shared \
--enable-pthreads \
--enable-version3 \
--enable-hardcoded-tables \
--cc=gcc \
--host-cflags= \
--host-ldflags= \
--enable-ffplay

Confirm ffbuild/config.mak file

~$ vim ffbuild/config.mak
Command mode input: ` ` CONFIG_FFPLAY ` ` to search
 If 'CONFIG_FFPLAY=yes', ffplay player will be installed along with compilation and installation

Compilation and installation

make -j 4  # Use 4 threads to compile at the same time to speed up compilation

After completion, the following words were found:

STRIP   ffprobe
STRIP   ffplay
STRIP   ffmpeg

It means that ffprobe, ffplay and ffmpeg will be installed

make  install

Modify Library Directory

sudo vim /etc/ld.so.conf
//Add: / home/niko/Applications/ffmpeg/lib
sudo ldconfig

Add to environment variable

cd ~
vim .bashrc
//Add to:
export FFMPEG_HOME=/home/Applications/ffmpeg
export PATH=$FFMPEG_HOME/bin:$PATH
source .bashrc

Refresh Library

sudo ldconfig

test

 ffmpeg -version
 ffplay -version

Posted by dlgilbert on Mon, 02 Dec 2019 14:23:04 -0800