Build Guide - Crowsinc/LiveVisionKit GitHub Wiki

This page outlines instructions and options for compiling and installing LiveVisionKit using the provided CMake systems. Basic development and CMake knowledge is assumed for all instructions, feel free to reach out for support if necessary.

Requirements

  • CMake 3.21 or greater.
  • A modern C++ 20 compiler (GCC or MSVC).
  • Visual Studio 2019 (Windows Only)

Build Instructions

Windows

Automated

Clone the LiveVisionKit project and head to the Scripts folder. Run the build_w64.ps1 PowerShell script using the optional arguments listed below:

  • -plugin: If set, builds OBS-Studio plugin.
  • -editor: If set, builds the Video Editor command-line tool.
  • -install: If set, automatically installs the OBS-Studio plugin to the default OBS-Studio install location.
  • -config: Specifies the desired CMake configuration to use when building LVK and its dependencies (defaults to Release).

An example of the required PowerShell commands is shown below:

git clone https://github.com/Crowsinc/LiveVisionKit.git
cd LiveVisionKit\Scripts\

.\build_w64.ps1 -plugin -install -config RelWithDebInfo

Manual

  1. Download the latest OpenCV Windows binaries by using the self-extracting executable (e.g. opencv-4.6.0-vc14_vc15.exe). Alternatively, you may build OpenCV yourself to get more control over its configuration options. Please ensure your build meets the OpenCV Specifications outlined below.

  2. If building the OBS-Studio plugin: follow the automatic build instructions for OBS-Studio, then install the compiled binaries to the build folder. Example PowerShell commands are provided below for a typical build procedure:

git clone --recursive https://github.com/obsproject/obs-studio.git
cd obs-studio

.\CI\build-windows.ps1 -BuildConfiguration RelWithDebInfo
cmake --install .\build64\ --prefix .\build64\install\ --config RelWithDebInfo
  1. Clone the latest version of Eigen and build it using CMake. Example PowerShell commands are provided below:
git clone https://gitlab.com/libeigen/eigen.git
cd Eigen

mkdir build; cd build
cmake ..
cmake --build .
  1. Clone the LiveVisionKit project and configure the CMake build using the options specified in the CMake Options section. Example PowerShell commands are provided below for a typical build procedure. Make sure to substitute your own OpenCV and OBS-Studio build paths.
git clone https://github.com/Crowsinc/LiveVisionKit.git
cd LiveVisionKit

mkdir build; cd build
cmake -D OPENCV_BUILD_PATH="<your opencv directory>/build" -D EIGEN_BUILD_PATH="<your eigen directory>/build" -D OBS_BUILD_PATH="<your obs-studio directory>/build64" -D OBS_PLUGIN_AUTO_INSTALL=ON ..
  1. Open the LiveVisionKit.sln Visual Studio solution that was generated in the build folder. Pick your desired compilation configuration (e.g. Debug, Release, etc.) and run the ALL_BUILD CMakeTarget to compile LiveVisionKit and all enabled modules.

  2. Run the INSTALL CMakeTarget to generate installation packages in <build folder>/Install/Releases. If the OBS_AUTO_INSTALL option is set, the built OBS plugin will be automatically installed to all configured locations. Note that not all install packages are generated on debug builds.

Linux (Debian Based)

Automated

Clone the LiveVisionKit project and head to the Scripts folder. Run the build_deb.sh script using the optional arguments listed below:

  • -p: If set, builds OBS-Studio plugin.
  • -e: If set, builds the Video Editor command-line tool.
  • -i: If set, automatically installs the OBS-Studio plugin to the default OBS-Studio install location.
  • -c: Specifies the desired CMake configuration to use when building LVK and its dependencies (defaults to Release).

An example of the required terminal commands is shown below:

git clone https://github.com/Crowsinc/LiveVisionKit.git
cd LiveVisionKit/Scripts/

./build_deb.sh -p -i -c RelWithDebInfo

Manual

  1. Install the latest OpenCV package as provided by your package manager. Alternatively, you may build OpenCV yourself to get more control over its configuration options. Please ensure your build meets the OpenCV Specifications outlined below.

  2. If building the OBS-Studio plugin: follow the automatic build instructions for OBS-Studio, then install the compiled binaries to the build folder. Example terminal commands are provided below for a typical build procedure:

git clone --recursive https://github.com/obsproject/obs-studio.git
cd obs-studio

sudo ./CI/build-linux.sh
cmake --install ./build/ --prefix ./build/install/
  1. Clone the latest version of Eigen and build it using CMake. Example terminal commands are provided below:
git clone https://gitlab.com/libeigen/eigen.git
cd Eigen

mkdir build && cd build
cmake ..
cmake --build .
  1. Clone the LiveVisionKit project and configure the CMake build using the options specified in the CMake Options section. Example terminal commands are provided below for a typical build procedure. Make sure to substitute your own OBS-Studio build path. If you are using your own OpenCV build, you will also need to supply an OpenCV build path using OPENCV_BUILD_PATH.
git clone https://github.com/Crowsinc/LiveVisionKit.git
cd LiveVisionKit

mkdir build && cd build
cmake -D OBS_BUILD_PATH="<your obs-studio directory>/build" -D OBS_PLUGIN_AUTO_INSTALL=ON ..
  1. Compile and install LiveVisionKit using the Makefile generated in the build folder. This can be completed with make -j<n> (using n processors), and sudo make install respectively. If the OBS_AUTO_INSTALL option is set, the built OBS plugin will be automatically installed to all configured locations. Note that not all install packages are generated on debug builds.

CMake Options

Mandatory:

  • OPENCV_BUILD_PATH: The path to the OpenCV build folder
  • OBS_BUILD_PATH: The path to the OBS-Studio build folder (Only if BUILD_OBS_PLUGIN is set)
  • EIGEN_BUILD_PATH: The path to the Eigen 3 build folder

Optional:

  • BUILD_VIDEO_EDITOR: If set, builds the Video Editor command-line tool.
  • BUILD_OBS_PLUGIN: If set, builds the OBS-Studio plugin.
  • OBS_PLUGIN_AUTO_INSTALL: If set, automatically installs the OBS-Studio plugin to the list of install paths provided by OBS_PLUGIN_AUTO_INSTALL_PATHS.
  • OBS_PLUGIN_AUTO_INSTALL_PATHS: The list of paths to which the OBS-Studio plugin will be installed to if OBS_PLUGIN_AUTO_INSTALL is set.
  • OBS_PLUGIN_SHOW_LOCALE_TAG: If set, replaces all OBS-Studio plugin translations with their string identifier tags.
  • OBS_PLUGIN_PRINT_SETTINGS: If set, all LVK filters will print their configured settings if updated by the user.
  • OBS_PLUGIN_FAST_DMA: If set, enables the experimental use of faster DMA operations with OpenGL. (Linux Only)
  • DISABLE_CHECKS: If set, disables all asserts and error checks during compilation.
  • OPENCV_MODULES: Specifies the desired OpenCV modules to link.

OpenCV Specifications

Mandatory Options:

  • BUILD_opencv_core=ON
  • BUILD_opencv_calib3d=ON
  • BUILD_opencv_features2d=ON
  • BUILD_opencv_flann=ON
  • BUILD_opencv_imgproc=ON
  • BUILD_opencv_video=ON
  • BUILD_opencv_videoio=ON
  • BUILD_opencv_highgui=ON
  • BUILD_opencv_ts=OFF
  • BUILD_opencv_stitching=OFF
  • BUILD_opencv_objdetect=OFF
  • BUILD_opencv_python3=OFF
  • BUILD_opencv_photo=ON
  • BUILD_opencv_gapi=OFF
  • BUILD_opencv_dnn=OFF
  • BUILD_opencv_ml=OFF
  • BUILD_opencv_world=ON (Windows only)
  • WITH_OPENCL=ON
  • WITH_EIGEN=OFF
  • WITH_QT=ON (Linux Only)

Recommended Options:

  • WITH_OPENGL=ON (For OBS Plugin, Linux only)
  • WITH_DIRECTX=ON (For OBS Plugin, Windows only)
  • WITH_OPENCL_D3D11_NV=ON (For OBS Plugin, Windows only)
  • ENABLE_LTO=ON
  • BUILD_EXAMPLES=OFF
  • BUILD_TESTS=OFF
  • BUILD_opencv_apps=OFF