Open Shot Install-Windows
Open Shot Install-Windows
--
© OpenShot Studios, LLC
SPDX-License-Identifier: LGPL-3.0-or-later
-->
## 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 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
## Dependencies
### Qt 5 (libqt5)
* 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...
* MAGICKCORE_HDRI_ENABLE (default 0)
* MAGICKCORE_QUANTUM_DEPTH (default 0)
* OPENSHOT_IMAGEMAGICK_COMPATIBILITY (default 0)
* DISABLE_TESTS (default 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`)
## 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.
* 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 are an example`)
* `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\`
The first step in installing libopenshot is to obtain the most recent source code.
The source code
is available on [GitHub](https://github.com/OpenShot/libopenshot). Use the
following command to
obtain the latest libopenshot source code.
```
git clone https://github.com/OpenShot/libopenshot.git
git clone https://github.com/OpenShot/libopenshot-audio.git
```
## Folder Structure (libopenshot)
### 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.
```
PATH=$PATH:/c/msys64/mingw64/bin:/c/msys64/mingw64/lib (64-bit PATH)
or
PATH=$PATH:/c/msys64/mingw32/bin:/c/msys64/mingw32/lib (32-bit PATH)
```
```
pacman -Syu
```
5a) Install the following packages (**64-Bit**)
```
pacman -S --needed --noconfirm \
mingw-w64-x86_64-rust base-devel mingw-w64-x86_64-toolchain \
mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-qt5 mingw-w64-x86_64-python3-pyqt5 \
mingw-w64-x86_64-swig mingw-w64-x86_64-cmake mingw-w64-x86_64-doxygen \
mingw-w64-x86_64-python3-pip mingw-w64-i686-zeromq mingw-w64-x86_64-python3-pyzmq \
mingw-w64-x86_64-python3-cx_Freeze mingw-w64-x86_64-ninja mingw-w64-x86_64-catch \
mingw-w64-x86_64-python3-PyOpenGL mingw-w64-clang-x86_64-python-pyopengl-accelerate
\
mingw-w64-x86_64-python-pyopengl-accelerate mingw-w64-x86_64-python-pywin32 git
```
pacman -S --needed --noconfirm \
mingw-w64-i686-rust mingw-w64-i686-toolchain mingw-w64-i686-ffmpeg \
mingw-w64-i686-qt5 mingw-w64-i686-python3-pyqt5 mingw-w64-i686-swig \
mingw-w64-i686-cmake mingw-w64-i686-doxygen mingw-w64-i686-python3-pip \
mingw-w64-i686-zeromq mingw-w64-i686-python3-pyzmq mingw-w64-i686-python3-cx_Freeze
\
mingw-w64-i686-ninja mingw-w64-i686-catch mingw-w64-i686-python-pyopengl \
mingw-w64-i686-python-pyopengl-accelerate mingw-w64-i686-python-pywin32
```
pip3 install httplib2
pip3 install slacker
pip3 install tinys3
pip3 install github3.py
pip3 install requests
pip3 install meson
pip3 install PyOpenGL
pip3 install PyOpenGL-accelerate
```
```
cmake -G "MSYS Makefiles" ../ -DCMAKE_MAKE_PROGRAM=mingw32-make -
DCMAKE_INSTALL_PREFIX:PATH=/usr
mingw32-make install
```
Note: Had to edit 1 header file and add a missing typedef: `typedef unsigned int
uint;`
```
git clone https://github.com/opencv/opencv
cd opencv/
git checkout '4.3.0'
cd ..
git clone https://github.com/opencv/opencv_contrib
cd opencv_contrib/
git checkout '4.3.0'
cd ..
cd opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D WITH_TBB=OFF -D WITH_QT=ON -D WITH_OPENGL=ON -
D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -D
OPENCV_GENERATE_PKGCONFIG=ON -D BUILD_opencv_python2=OFF -D BUILD_opencv_python3=ON
-G "MSYS Makefiles" ..
make -j4 -i (-i ignores errors on MSYS2 which happens for some reason)
make install -i
```
```
git clone https://github.com/RazrFalcon/resvg
cd resvg/crates/c-api
QT_DIR="C:\\msys64\\mingw64\\" cargo build --verbose --release
**OR**
QT_DIR="C:\\msys64\\mingw32\\" cargo build --verbose --release
cd ../../
## Manual Dependencies
### DLfcn
* https://github.com/dlfcn-win32/dlfcn-win32
* Download and Extract the Win32 Static (.tar.bz2) archive to a local folder:
`C:\libdl\`
* Create an environment variable called DL_DIR and set the value to `C:\libdl\`.
This environment variable will be used by CMake to find the binary and header file.
### libSndFile
* http://www.mega-nerd.com/libsndfile/#Download
* Download and Install the Win32 Setup program.
* Create an environment variable called SNDFILE_DIR and set the value to `C:\
Program Files\libsndfile`. This environment variable will be used by CMake to find
the binary and header files.
### libzmq
* http://zeromq.org/intro:get-the-software
* Download source code (zip)
* Follow their instructions, and build with mingw
* Create an environment variable called ZMQDIR and set the value to `C:\libzmq\
build\` (the location of the compiled version). This environment variable will be
used by CMake to find the binary and header files.
```
cd [libopenshot-audio repo folder]
mkdir build
cd build
cmake -G “MinGW Makefiles” ../
mingw32-make
mingw32-make install
openshot-audio-test-sound (This should play a test sound)
```
```
cd [libopenshot repo folder]
mkdir build
cd build
cmake -G "MinGW Makefiles" -DPYTHON_INCLUDE_DIR="C:/Python34/include/" -
DPYTHON_LIBRARY="C:/Python34/libs/libpython34.a" ../
mingw32-make
```
If you are missing any dependencies for libopenshot, you will receive error
messages at this point.
Just install the missing dependencies, and run the above commands again. Repeat
until no error
messages are displayed and the build process completes.
Also, if you are having trouble building, please see the CMake Flags section above,
as
it might provide a solution for finding a missing folder path, missing Python 3
library, etc...
To run all unit tests (and verify everything is working correctly), launch a
terminal, and enter:
```
mingw32-make test
```
```
mingw32-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).
```
mingw32-make install
```
This should copy the binary files to `C:\Program Files\openshot\lib\`, and the
header
files to `C:\Program Files\openshot\include\...` 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
```