Published using Google Docs
Installation Guide: OpenShot Video Library | libopenshot
Updated automatically every 5 minutes

Installation Guide

OpenShotTM Video Library | libopenshot (C++)

Introduction

Features

License

Getting Started

Build Tools

Dependencies

Obtaining Source Code

Folder Structure

Developer Tools (IDE)

Linux Build Instructions

Install Dependencies (via Package Manager)

Build & Install libopenshot-audio (Dependency)

Build & Install OpenShot Video Library (libopenshot) on Linux

Windows Build Instructions

Install Dependencies (Manually)

Build & Install OpenShot Video Library (libopenshot) on Windows

Environment Variables

Mac Build Instructions

Install Dependencies (Homebrew)

Build & Install libopenshot-audio (Dependency)

Build & Install OpenShot Video Library (libopenshot) on Mac

CMake Flags (Optional)

Installers / Packaging

Packaging Bazaar Branch

Daily PPA for Ubuntu

PyQt Interface (Optional)

Obtaining Source Code

Folder Structure

Linux Instructions

Windows Instructions

Mac Instructions

Launching the App

Build an Installer

Conclusion

Donations

Introduction

The OpenShot Video Library (also known as libopenshot) was created to provide a free and open-source video editing, composition, animation, and playback library, which focuses on professional-quality features, stability, cross-platform support, and multi-core processor support.  The library is written in C++ and includes full bindings for Python and Ruby.  These instructions are designed for programmers, packagers, and adventurers who are interested in compiling and installing the source code.

Features

License

Copyright (c) 2008-2015 OpenShot Studios, LLC

<http://www.openshotstudios.com/>.

OpenShot Library (libopenshot) is free software: you can redistribute it

and/or modify it under the terms of the GNU Lesser General Public License

as published by the Free Software Foundation, either version 3 of the

License, or (at your option) any later version.

OpenShot Library (libopenshot) is distributed in the hope that it will be

useful, but WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License

along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.

Getting Started

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 all 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.

Build Tools

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/ folder.  This prevents the build process from cluttering up the source code.  These instructions have only been tested with the GNU compiler (including MinGW for Windows).

Dependencies

The following libraries are required to build libopenshot.  Instructions on how to install these dependencies are listed under each operating system below.  Libraries and Executables have been color-coded in the list below to help distinguish between them.

Library

Executable

Compiler Flag

Obtaining Source Code

The first step in installing libopenshot is to obtain the most recent source code.  The source code is available on launchpad.net/libopenshot/. You can pull the latest version using the Bazaar source control system, which is very similar to Git. There are two separate libraries you need to compile: libopenshot-audio and libopenshot. You will need to pull the source code for both libraries with the following commands.

Folder Structure

The source code is divided up into the following folders.

build/

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).

cmake/

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.

doc/

This folder contains documentation and related files, such as logos and images required by the doxygen auto-generated documentation.

include/

This folder contains all headers (*.h) used by libopenshot.

src/

This folder contains all source code (*.cpp) used by libopenshot.

tests/

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.

thirdparty/

This folder contains code not written by the OpenShot team. For example, jsoncpp, an open-source JSON parser.


Developer Tools (IDE)

While any text editor and terminal will allow you to make changes and compile libopenshot, we recommend the following configuration (which works on Mac, Windows, and Linux).

Now that you have an overview of the project, structure of the source code, and recommended tools, jump to the instructions for your operating system:

Linux Build Instructions

These build instructions are for a Debian-based Linux distribution.  Other Linux distributions should be very similar, but might also be subtly different.  So, exercise caution if you are using a non-Debian distribution.

Install Dependencies (via Package Manager)

Most packages needed by libopenshot can be installed easily with a package manager.  Install the following packages using apt-get, Synaptic, or similar package manager:

Build & Install libopenshot-audio (Dependency)

Since libopenshot-audio is not available in a Debian package, we need to go through a few additional steps to manually build and install it.

Build & Install OpenShot Video Library (libopenshot) on Linux

The first step in installing libopenshot is to obtain the most recent source code.  The source code is available on launchpad.net/libopenshot.  

Windows Build Instructions

These build instructions are for Windows 7, but should work for other versions of Windows as well.  There are many additional steps when using Windows to build libopenshot, and will require the downloading and installation of many different applications, libraries, and tools.  These instructions are based on the MinGW (Minimalist GNU for Windows) compiler.  Visual Studio can not be used with these instructions.  In fact, libraries that are built with Visual Studio can not be linked correctly using MinGW, so all dependency libraries need to be built with MinGW as well.

TIP:  When running commands in the command line or other terminal shells, be sure and “Run as administrator” whenever possible.  Many of these commands will create folders or copy files, and might not have permission. Also, I recommend using a better terminal than cmd.exe, for example Clink.

Install Dependencies (Manually)

Unfortunately, Windows does not have a simple way to install commonly used libraries and applications, similar to a Linux package manager.  So, you will need to manually find, download, and install each dependency application and library, making sure the binaries are compiled with MinGW (and not Visual Studio).  In a few cases, you will have to compile a library manually with MinGW, if no suitable MinGW binaries can be found online.  This is going to take a while, so be sure you have some free time before continuing beyond this point.  Good luck!

Build & Install OpenShot Video Library (libopenshot) on Windows

The first step in installing libopenshot is to obtain the most recent source code.  The source code is available on launchpad.net/libopenshot.  

Environment Variables

Many environment variables will need to be set during this Windows installation guide.  The command line will need to be closed and re-launched after any changes to your environment variables.  Also, dependency libraries will not be found during linking or execution without being found in the PATH environment variable.  So, if you get errors related to missing commands or libraries, double check the PATH variable.

The following environment variables need to be added to your “System Variables”.  Be sure to check each folder path for accuracy, as your paths will likely be different than this list.

Example Variables

DL_DIR

C:\libdl

DXSDK_DIR

C:\Program Files\Microsoft DirectX SDK (June 2010)\

FFMPEGDIR

C:\ffmpeg-git-95f163b-win32-dev

FREETYPE_DIR

C:\Program Files\GnuWin32

HOME

C:\msys\1.0\home

LIBOPENSHOT_AUDIO_DIR

C:\Program Files\libopenshot-audio

QTDIR

C:\qt5

SNDFILE_DIR

C:\Program Files\libsndfile

UNITTEST_DIR

C:\UnitTest++

ZMQDIR

C:\msys2\usr\local\

PATH

The following paths were appended:

C:\Qt5\bin; C:\Qt5\MinGW\bin\; C:\msys\1.0\local\lib; C:\Program Files\CMake 2.8\bin; C:\UnitTest++\build; C:\libopenshot\build\src; C:\Program Files\doxygen\bin; C:\ffmpeg-git-95f163b-win32-dev\lib; C:\swigwin-2.0.4; C:\Python33; C:\Program Files\Project\lib; C:\msys2\usr\local\

Mac Build Instructions

These build instructions are for Mac OS X (Mountain Lion).  Other OS X versions should be very similar, but might also be subtly different.  So, exercise caution if you are using a non-Mountain Lion version.

Install Dependencies (Homebrew)

Most packages needed by libopenshot can be installed easily with MacPorts or Homebrew.  However, before MacPorts can be installed, you must first install Xcode with the following options ("UNIX Development", "System Tools", "Command Line Tools", or "Command Line Support"). Be sure to refresh your list of MacPort packages with the “sudo port selfupdate” command and update your Homebrew packages with “brew update”.

NOTE: Homebrew seems to work much better for most users, so I am going to focus on brew for the rest of this guide.

Install the following packages using the Homebrew package installer (http://brew.sh/). Pay close attention to any warnings or errors during these brew installs. NOTE: You might have some conflicting libraries in your /usr/local/ folders, so follow the directions from brew if these are detected.

Install the following packages manually (because Homebrew does not have them):

Build & Install libopenshot-audio (Dependency)

Since libopenshot-audio is not available in a Homebrew or MacPorts package, we need to go through a few additional steps to manually build and install it.

Build & Install OpenShot Video Library (libopenshot) on Mac

The first step in installing libopenshot is to obtain the most recent source code.  The source code is available on launchpad.net/libopenshot.  

CMake Flags (Optional)

There are many different build flags that can be passed to cmake to adjust how libopenshot is compiled. Some of these flags might be required when compiling on certain OSes, just depending on how your build environment is setup. To add a build flag, follow this general syntax:  $ cmake -DMAGICKCORE_HDRI_ENABLE=1 -DENABLE_TESTS=1 ../

MAGICKCORE_HDRI_ENABLE

0

MAGICKCORE_QUANTUM_DEPTH

16

OPENSHOT_IMAGEMAGICK_COMPATIBILITY

0

DISABLE_TESTS

0

CMAKE_PREFIX_PATH

/location/to/missing/library/

PYTHON_INCLUDE_DIR

/location/to/python/include/

PYTHON_LIBRARY

/location/to/python/lib.a

PYTHON_FRAMEWORKS

/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/

CMAKE_CXX_COMPILER

/location/to/mingw/g++

CMAKE_C_COMPILER

/location/to/mingw/gcc

Installers / Packaging

Many different installers and packages (as they are called on Linux and Mac) have been created for libopenshot and libopenshot-audio. The source code for these packages is located in a separate Bazaar branch.

Packaging Bazaar Branch

https://code.launchpad.net/~openshot.packagers/libopenshot/packaging.

Daily PPA for Ubuntu

For Ubuntu, we also have a daily built repository / PPA for libopenshot and libopenshot-audio: https://launchpad.net/~openshot.developers/+archive/ubuntu/libopenshot-daily

PyQt Interface (Optional)

Once you have successfully installed libopenshot and libopenshot-audio, you now have the option of installing our PyQt5 desktop video editor: OpenShot Video Editor 2.0. Here are the general instructions for installing OpenShot 2.0. Note: OpenShot 1.x does not use PyQt or libopenshot (and is only compatible with Linux).

Obtaining Source Code

The first step to installing our desktop video editor (i.e. OpenShot Video Editor 2.0), is to download the source code. And luckily, this source code is Python 3 and JavaScript, and does not need to be compiled. The source code is available on LaunchPad, but is still highly experimental and has many known issues.

Launch a terminal, and enter:

Folder Structure

The source code is divided up into the following folders.

bin/

This folder contains the script that launches OpenShot 2.0

doc/

This folder contains documentation and related files, such as logos and images required by the doxygen auto-generated documentation.

installer/

This folder contains misc files related to installers, or the creation of installers for OpenShot 2.0.

src/

This folder contains all source code (*.py and *.js) used by libopenshot.

… /blender/

This folder contains the Blender 3D animation files, used for animated titles and other 3D effects.

… /classes/

This folder contains most of our primary classes and utility Python methods. Such as our app.py, info.py, and other top level functions.

… /effects/

This folder contains the meta data for our effects. Such as effect thumbnails, XML files, etc...

… /images/

This folder contains misc images used by OpenShot 2.0 (i.e. logo).

… /locale/

This folder contains language translations for OpenShot 2.0.

… /presets/

This folder contains presets for our export dialog. The presets are XML files that describe common combinations of export settings, such as DVD NTSC.

… /profiles/

This folder contains profiles for different screen resolutions, frame rates, aspect ratios, etc...

… /settings/

This folder contains the default settings file used by OpenShot 2.0, as well as the default timeline JSON file.

… /tests/

This folder contains Python unit tests for OpenShot 2.0.

… /timeline/

This folder contains the JavaScript source code and HTML used by the timeline widget. It uses Angular.js and JQuery UI to bind to the timeline’s JSON structure and render the timeline. This HTML can actually be tested and debugged outside of the PyQt application, using a recent version of Google Chrome.

… /titles/

This folder contains the SVG vector titles uses by OpenShot 2.0.

… /transitions/

This folder contains the grayscale transition images, used to fade between different clips / videos.

… /uploads/

This folder contains the YouTube and Vimeo source code, to upload exported videos directly to a user’s account.

… /windows/

This folder contains all the .UI files and Window classes used by OpenShot 2.0. Much of our source code is inside this folder, as most of our source code relates to windows, dialogs, and interfaces.

xdg/

This folder contains some Linux specific files, related to packaging, such as the .desktop launcher file, icon, and mime type data.


Linux Instructions

Here is a list of the packages you need to install via your Linux package manager. These are the package names on Ubuntu, so your OS might have different names for these packages.

Windows Instructions

To run our desktop video editor on Windows, you need to install the frameworks and dependencies that are required, such as PyQt5 and Python 3+.

Mac Instructions

These packages are needed by OpenShot 2.0, and can be installed easily with MacPorts or Homebrew.  NOTE: Homebrew seems to work much better for most users, so I am going to focus on brew for the rest of this guide.

Install the following packages using the Homebrew package installer (http://brew.sh/).

Launching the App

To launch OpenShot 2.0 from source code, you must use the terminal / command line. Navigate to the correct folder: /openshot-qt/, and run the following command:

If you see any error messages printed to the terminal, it usually means that a dependency is missing, such as libopenshot or PyQt. Hopefully with some careful googling, you can figure out what is missing and fix it. Good luck!

Build an Installer

To create an installer / redistributable package for OpenShot Video Editor 2.0, we are utilizing a program called “cx_Freeze”, which bundles up all the related dependencies, python 3 libraries, Qt libraries, and other required files into a single executable. Take a look at the source file /installer/build-server.py for examples of how to create installers for each OS.

OpenShot Video Editor comes with an easy wrapper for cx_Freeze, called “freeze.py”, located in the main source code folder.

Conclusion

I hope this Installation Guide was useful to you, and I hope you are now enjoying the OpenShot Video Library.  Be sure to contact me if you use this library for anything interesting or exciting, as I would love to hear about it and share it with the community.  Also, if you are interested in obtaining a commercial license, please contact me for more details: jonathan@openshot.org.

Donations

If you find any use or enjoyment from this library, I encourage you to donate a few dollars to our project.  Even the smallest contributions add up and help fund meetings, conferences, travel expenses, and of course, my time to continue to improve this exciting project.  For more information on donations, please visit www.openshot.org/donate/. Thank you so much for your support!