Installation for the Apple 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.)

The Terminal is usually found in the /Applications/Utilities folder.

Installing the software with Homebrew

Homebrew

Install Homebrew, a package manger for macOS and Linux. You may think of it as an «app store» for open-source software. You can install Homebrew by pasting the following command:

 

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

 

After successful installation you should execute:

 

brew doctor

 

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

FFmpeg

Once Homebrew is installed, for our purpose, we recommend building FFmpeg with the following command:1

 

brew install varenc/ffmpeg/ffmpeg --with-openjpeg --with-rubberband --with-tesseract

 

As, sadly, the «America only» 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

Installing the software from a build

Download the binaries of the latest release:

 

Open the disk images and drag & drop the binaries to your Desktop.

For the OS X 10.6 to 10.10 users

To install the software to the correct place, paste the following command at a Terminal prompt:

 

sudo mv -iv ~/Desktop/ff* /usr/local/bin

For the OS X 10.11 and the macOS 10.12 to 10.14 users

Sadly, Apple introduced an additional complication with the System Integrity Protection. Before you can move the binaries, you need to deactivate it:

  • boot into Recovery Mode: hold down command + R on reboot
  • paste the following command at a Terminal prompt:
    csrutil disable
  • reboot

 

To install the software to the correct place, paste the following command at a Terminal prompt:

 

sudo mv -iv ~/Desktop/ff* /usr/local/bin

 

Once the installation is completed, we advise to set the System Integrity Protection back again to its original state:

  • boot into Recovery Mode: hold down command + R on reboot
  • paste the following command at a Terminal prompt:
    csrutil enable
  • reboot

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-tesseract
Enables the Tesseract video filter for optical character recognition, e.g. for extracting intertitles or subtitles.

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

 

brew options varenc/ffmpeg/ffmpeg

 

Additional information about this formula are available on Chris Varenhorst’s GitHub repository.


2019–07–09