Compiling Olive

So you think you can compile Olive yourself?

...Well, you're right!

Olive is open source meaning all the source code is available to users for them to modify themselves and compile on any platform they see fit.

Olive currently has two major dependencies: Qt 5.5+ and FFmpeg 3.4+. The following are instructions designed to help you on your way to acquiring these dependencies and using them to compile Olive.

Compiling on Windows
Compiling on macOS
Compiling on Linux

Compiling on Windows

There are two major C++ compilers on Windows: Microsoft Visual C++ (MSVC) and MingW. While it is very possible to compile with MSVC, Olive doesn't yet provide a .sln file to make it easy. As a result, for this tutorial we'll use MingW.

Firstly, you'll need to download MSYS2 (the build environment for MingW). Download it at: https://www.msys2.org/.

Once MSYS2 is installed, open it. There are a couple different variants it'll install, for 64-bit machines you'll want "MSYS2 MinGW 64-bit" and for 32-bit you'll want "MSYS2 MinGW 32-bit".

In MSYS2, you can now use its package manager pacman install Olive's dependencies.

To install Qt, use the following command for 64-bit:

pacman -S mingw-w64-x86_64-qt5

Or this one for 32-bit:

pacman -S mingw-w64-i686-qt5

Next we'll install FFmpeg the same way.

For 64-bit:

pacman -S mingw-w64-x86_64-ffmpeg

For 32-bit:

pacman -S mingw-w64-i686-ffmpeg

Olive optionally implements Frei0r, an open source video effects library. This is not essential, but to compile with this, you'll have to download the source code for Frei0r from GitHub and place frei0r.h (in the include folder) in an include directory for the compile process (e.g. C:\msys64\mingw64\include for 64-bit or C:\msys64\mingw32\include for 32-bit). You'll also likely have to compile them yourself to use the effects in Olive (the MLT website has instructions for compiling Frei0r with MSYS2), or alternatively use the existing Frei0r DLLs in the official Windows download.

Now it's time to acquire the source code. You can either download a ZIP directly from GitHub, or download through MSYS2 with git.

To install through git, first install it:

pacman -S git

Then clone the Olive repository:

git clone https://github.com/olive-editor/olive.git

Alternatively, if you downloaded through ZIP, make sure you extract all the files into a folder before proceeding.

Enter the Olive source code directory. If you used git, simply run cd olive. If you used ZIP, you can type cd (keeping the space at the end), and then drag the folder you extracted Olive into to MSYS2. Then press enter and it will enter that directory.

Generate a Makefile:

qmake

If you didn't install Frei0r earlier, you'll need to disable it. Otherwise skip this step.

qmake "DEFINES+=NOFREI0R"

All being well, you should now be able to compile Olive.

make
Once this process is done, Olive is compiled! In the source code folder, you should be able to find and run olive-editor.exe.

Compiling on macOS

Open up Terminal and use the following instructions to build Olive from source.

First we'll need our build environment and compilers, which on the Mac come in the form of Xcode. Install Xcode Command Line Tools by typing:

xcode-select --install

Next, there are a few different ways to install the Qt and FFmpeg dependencies, but the easiest is to install the Homebrew package manager and install both through it.

To install Homebrew, follow the instructions on the official website.

Once Homebrew is installed, use it to install Qt 5:

brew install qt5

And then FFmpeg:

brew install ffmpeg

An optional dependency is Frei0r to allow many more extra video effects. It's not essential, but to install it, use:

brew install frei0r

By this point, all dependencies should be installed. Grab a copy of the source code with:

git clone https://github.com/olive-editor/olive.git

Enter the Olive folder:

cd olive

Generate a Makefile:

qmake

If qmake doesn't work, you could try these options:

1. Force the link of the just installed Qt5:

brew link qt5 --forces

2. if the previous one doesn't work try:

brew info qt
echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile
export LDFLAGS="-L/usr/local/opt/qt/lib"
export CPPFLAGS="-I/usr/local/opt/qt/include"
export PKG_CONFIG_PATH="/usr/local/opt/qt/lib/pkgconfig"
. ~/.bash_profile

If you didn't install Frei0r earlier, you'll need to disable it. Otherwise skip this step.

qmake "DEFINES+=NOFREI0R"

Finally run make to compile Olive:

make

Once make is complete Olive should be ready to run, so open the folder with Finder and launch the new .app file.

Enjoy!


Compiling on Linux

Depending on your distribution, the provided package manager should include recent enough versions of both of these dependencies. For demonstration purposes, we shall use Ubuntu 18.04, but most distributions should have equivalent commands.

Open up Terminal and use the following instructions to build Olive from source.

First our build environment:

sudo apt-get install build-essential

Next, we'll need to install Qt 5:

sudo apt-get install qt5-default qtmultimedia5-dev libqt5multimedia5 libqt5multimedia5-plugins

Olive relies on Qt's multimedia module and plugins to play audio, which are not installed by default, so we have to add them manually here. If Olive plays no sound on your setup, it's very likely you don't have Qt multimedia plugins installed.

Qt also provides an official Linux installer on [their website](https://qt.io/) which, depending on your distribution, may provide you with a much more recent version.

To install the FFmpeg libraries necessary for building:

sudo apt-get install libavformat-dev libavcodec-dev libavfilter-dev libavutil-dev libswscale-dev libswresample-dev

Olive's format/codec support is provided more or less entirely by FFmpeg. While the FFmpeg build from your distribution's package manager should cover most of the major formats in use today, compiling it from source will give you full control over which codecs it (and hence Olive) will be able to support. Check [FFmpeg's compilation guide](https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu) for more information.

An optional dependency is Frei0r to allow many more extra video effects. It's not essential, but to install it, use:

sudo apt-get install frei0r-plugins-dev frei0r-plugins

By this point, all dependencies should be installed. Grab a copy of the source code with:

git clone https://github.com/olive-editor/olive.git

Enter the Olive folder:

cd olive

Generate a Makefile:

qmake

If you didn't install Frei0r earlier, you'll need to disable it. Otherwise skip this step.

qmake "DEFINES+=NOFREI0R"

And finally run make to compile Olive:

make

Optionally, run make install to install Olive on your computer:

sudo make install

Once make is complete, Olive should be ready to run.

./olive-editor
Enjoy!

Your platform not listed here? Request it!