-
Notifications
You must be signed in to change notification settings - Fork 278
Linux Build Instructions
The best way to get started with libopenshot, is to learn about our build system, obtain all the source code, install a development IDE and tools, and better understand our dependencies. So, please read through the following sections, and follow the instructions. And keep in mind, that your computer is likely different than the one used when writing these instructions. Your file paths and versions of applications might be slightly different, so keep an eye out for subtle file path differences in the commands you type.
CMake is the backbone of our build system. It is a cross-platform build system, which checks for dependencies, locates header files and libraries, generates makefiles, and supports the cross-platform compiling of libopenshot and libopenshot-audio. CMake uses an out-of-source build concept, where all temporary build files, such as makefiles, object files, and even the final binaries, are created outside of the source code folder, inside a /build/ sub-folder. This prevents the build process from cluttering up the source code. These instructions have only been tested with the GNU compiler (including MSYS2/MinGW for Windows).
The following libraries are required to build libopenshot. Instructions on how to install these dependencies vary for each operating system. Libraries and Executables have been labeled in the list below to help distinguish between them.
-
-
http://www.ffmpeg.org/
(Library)
- This library is used to decode and encode video, audio, and image files. It is also used to obtain information about media files, such as frame rate, sample rate, aspect ratio, and other common attributes.
-
http://www.ffmpeg.org/
-
-
http://www.imagemagick.org/script/magick++.php
(Library)
- This library is optional, and used to decode and encode images.
-
http://www.imagemagick.org/script/magick++.php
-
-
https://github.com/OpenShot/libopenshot-audio/
(Library)
- This library is used to mix, resample, host plug-ins, and play audio. It is based on the JUCE project, which is an outstanding audio library used by many different applications
-
https://github.com/OpenShot/libopenshot-audio/
-
-
http://www.qt.io/qt5/
(Library)
- Qt5 is used to display video, store image data, composite images, apply image effects, and many other utility functions, such as file system manipulation, high resolution timers, etc...
-
http://www.qt.io/qt5/
-
-
http://www.cmake.org/
(Executable)
- This executable is used to automate the generation of Makefiles, check for dependencies, and is the backbone of libopenshot’s cross-platform build process.
-
http://www.cmake.org/
-
-
http://www.swig.org/
(Executable)
- This executable is used to generate the Python and Ruby bindings for libopenshot. It is a simple and powerful wrapper for C++ libraries, and supports many languages.
-
http://www.swig.org/
-
-
http://www.python.org/
(Executable and Library)
- This library is used by swig to create the Python (version 3+) bindings for libopenshot. This is also the official language used by OpenShot Video Editor (a graphical interface to libopenshot).
-
http://www.python.org/
-
-
http://www.stack.nl/~dimitri/doxygen/
(Executable)
- This executable is used to auto-generate the documentation used by libopenshot.
-
http://www.stack.nl/~dimitri/doxygen/
-
-
https://github.com/unittest-cpp/
(Library)
- This library is used to execute unit tests for libopenshot. It contains many macros used to keep our unit testing code very clean and simple.
-
https://github.com/unittest-cpp/
-
-
http://zeromq.org/
(Library)
- This library is used to communicate between libopenshot and other applications (publisher / subscriber). Primarily used to send debug data from libopenshot.
-
http://zeromq.org/
-
-
http://openmp.org/wp/
(Compiler Flag)
- If your compiler supports this flag (GCC, Clang, and most other compilers), it provides libopenshot with easy methods of using parallel programming techniques to improve performance and take advantage of multi-core processors.
-
http://openmp.org/wp/
The first step in installing libopenshot is to obtain the most recent source code. The source code is available on GitHub. Use the following command to obtain the latest libopenshot source code.
git clone https://github.com/OpenShot/libopenshot.git
The source code is divided up into the following folders.
-
- This folder needs to be manually created, and is used by cmake to store the temporary build files, such as makefiles, as well as the final binaries (library and test executables).
-
- This folder contains custom modules not included by default in cmake, used to find dependency libraries and headers and determine if these libraries are installed.
-
- This folder contains documentation and related files, such as logos and images required by the doxygen auto-generated documentation.
-
- This folder contains all headers (*.h) used by libopenshot.
-
- This folder contains all source code (*.cpp) used by libopenshot.
-
- This folder contains all unit test code. Each class has it’s own test file (*.cpp), and uses UnitTest++ macros to keep the test code simple and manageable.
-
- This folder contains code not written by the OpenShot team. For example, jsoncpp, an open-source JSON parser.
In order to actually compile libopenshot, we need to install some dependencies on your system. The easiest way to accomplish this is with our Daily PPA. A PPA is an unofficial Ubuntu repository, which has our software packages available to download and install.
sudo add-apt-repository ppa:openshot.developers/libopenshot-daily
sudo apt-get update
sudo apt-get install openshot-qt \
cmake \
libx11-dev \
libasound2-dev \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavresample-dev \
libavutil-dev \
libfdk-aac-dev \
libfreetype6-dev \
libjsoncpp-dev \
libmagick++-dev \
libopenshot-audio-dev \
libswscale-dev \
libunittest++-dev \
libxcursor-dev \
libxinerama-dev \
libxrandr-dev \
libzmq3-dev \
pkg-config \
python3-dev \
qtbase5-dev \
qtmultimedia5-dev \
swig
Run the following commands to compile libopenshot:
cd [libopenshot repo directory]
mkdir -p build
cd build
cmake ../
make
If you are missing any dependencies for libopenshot, you might receive error messages at this point. Just install the missing packages (usually with a -dev suffix), and run the above commands again. Repeat until no error messages are displayed, and the build process completes. Also, if you manually install Qt 5, you might need to specify the location for cmake:
cmake -DCMAKE_PREFIX_PATH=/qt5_path/qt5/5.2.0/ ../
To run all unit tests (and verify everything is working correctly), launch a terminal, and enter:
make test
To auto-generate documentation for libopenshot, launch a terminal, and enter:
make doc
This will use doxygen to generate a folder of HTML files, with all classes and methods documented. The folder is located at build/doc/html/. Once libopenshot has been successfully built, we need to install it (i.e. copy it to the correct folder, so other libraries can find it).
make install
This will copy the binary files to /usr/local/lib/, and the header files to /usr/local/include/openshot/... This is where other projects will look for the libopenshot files when building. Python 3 bindings are also installed at this point. let's verify the python bindings work:
python3
>>> import openshot
If no errors are displayed, you have successfully compiled and installed libopenshot on your system. Congratulations and be sure to read our wiki on Becoming an OpenShot Developer! Welcome to the OpenShot developer community! We would love to meet you!
Want to make some OpenShot friends and join our open-source team? Please send me an email ([email protected]) and introduce yourself! All volunteers are welcome, regardless of skills and/or skill level. Let's build something amazing!