Installation for Linux users

First install the FFmpeg package using either Homebrew or a binary build. Then test that the software is properly installed. (The compilation from the source code is out of the scope of this tutorial.)

Table of Contents


Installing the software with Homebrew

Installing Homebrew

Homebrew is a package manger originally designed for macOS that works under Linux as well. You can install Homebrew by pasting the following command at a Terminal prompt:

 

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

 

Once the main installation finishes (it may take longtime), run the following four commands in the Terminal:

 

test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)"

test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

test -r ~/.bash_profile && echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.bash_profile

echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.profile

 

After successful installation you may restart the Terminal and execute:

 

brew doctor

 

Detailed instructions for Homebrew are posted at:
https://github.com/Homebrew/brew/blob/master/docs/README.md

Installing FFmpeg

Once Homebrew is installed, for our purpose, we recommend to install the most recent stable FFmpeg release with the following two commands:1

 

brew tap avpres/formulae

brew install --with-openjpeg --with-rubberband --with-svt-av1 --with-tesseract avpres/formulae/ffmpeg

 

If you really need it, you can also install the current FFmpeg development branch with the following two commands (please note that we generally do not recommend using the development branch in production):

 

brew tap avpres/formulae

brew install --HEAD --with-openjpeg --with-rubberband --with-svt-av1 --with-tesseract avpres/formulae/ffmpeg

 

As – sadly – the “America alone” ideology becomes predominant in the open-source community as well, if you need the support of more languages than just English, then you have to run an additional command:

 

brew install tesseract-lang

Upgrading FFmpeg with Homebrew

To update Homebrew and upgrade FFmpeg to the most recent stable release, use the following two commands:

 

brew update

brew upgrade avpres/formulae/ffmpeg

 

To update Homebrew and upgrade FFmpeg to the current development branch, use the following two commands:

 

brew update

brew upgrade --fetch-HEAD avpres/formulae/ffmpeg

Installing the software from a build

Please follow the instructions given at: ffmpeg.org/download.html

Testing your installation

Once you followed the installation above, you should have the commands ffmpeg, ffplay and ffprobe installed.

ffmpeg

Test ffmpeg by pasting into the Terminal the line:

 

ffmpeg -f lavfi -i mandelbrot -t 10 -pix_fmt yuv420p ~/Desktop/mandelbrot.mkv

 

This should produce on your Desktop a file of the Mandelbrot pattern.

ffplay

Test ffplay by pasting into the Terminal the line:

 

ffplay ~/Desktop/mandelbrot.mkv

 

This should play the Mandelbrot file.

ffprobe

Test ffprobe by pasting into the Terminal the line:

 

ffprobe -show_format -show_streams -print_format json ~/Desktop/mandelbrot.mkv

 

This should display the Mandelbrot file’s technical metadata.


Note

1

The recommended parameters are:

--with-openjpeg
Enables JPEG 2000 encoding and decoding with the OpenJPEG library.
--with-rubberband
Enables the Rubberband audio filter, which allows time-stretching and pitch-shifting.
--with-svt-av1
Enables the Scalable Video Technology for AV1 (SVT-AV1 encoder and decoder).
--with-tesseract
Enables the Tesseract video filter for optical character recognition, e.g. for extracting intertitles or subtitles from a digitised print.

 

To see the available options paste into the Terminal the line:

 

brew options avpres/formulae/ffmpeg


2023-05-30