Building - vaismais/obs-StreamFX GitHub Wiki

Building from Source

The StreamFX project natively supports two modes of building, Standalone and Bundled with OBS Studio, each with their own strengths and weaknesses. For beginner developers, it is recommended to start with a Bundled build and eventually progress to Standalone later on. This guide also assumes that you already have the minimum CMake knowledge required to configure and generate a project.

Bundled Builds

The main method to build StreamFX is to first set up an OBS Studio copy and then integrate the StreamFX repository into it.

  1. Uninstall any currently installed versions of StreamFX to prevent conflicts.
  2. Follow the OBS Studio build guide for automated building on your platform of choice.
    • MacOS: You will need to use the XCode generator to build StreamFX as the Ninja generator does not support the flags StreamFX requires.
  3. Integrate StreamFX into the OBS Studio build flow:
    1. Navigate to either of these directories:
      • With UI: <obs studio source>/UI/frontend-plugins
      • Without UI: <obs studio source>/plugins
    2. Open a git enabled shell (git-bash on windows).
    3. Run git submodule add 'https://github.com/Xaymar/obs-StreamFX.git' streamfx.
    4. Run git submodule update --init --recursive.
    5. Append the line add_subdirectory(streamfx) to the CMakeLists.txt file in the same directory.
  4. Run the same script(s) from step 2 again.
  5. Done. StreamFX is now part of the build.

CI-Style builds

This method is designed for continuous integration and releases, and requires significant knowledge of CMake, OBS, and various other tools. Additionally it is not guaranteed to work on every machine, as it is only designed for use in continuous integration and nowhere else. It may even stop being maintained entirely with no warning whatsoever. You are entirely on your own when you choose this method.

1. Install Prerequisites / Dependencies

Windows
  • CMake 3.20 (or newer)
  • Git
  • Visual Studio 2019 (or newer)
  • Optional: LLVM
    Used by clang-format and clang-tidy integration with ENABLE_CLANG.
  • Optional: InnoSetup
    Used for packaging installers and not required for anything else.
  • Compatible OBS Studio Dependencies
    Used for FFmpeg, CURL and other libraries. The file third-party/obs-studio/.github/workflows/main.yml lists the correct version as DEPS_VERSION_WIN.
  • Compatible Qt 5 or 6
    Used for User Interface elements. The file third-party/obs-studio/.github/workflows/main.yml lists the correct version as DEPS_VERSION_WIN and QT_VERSION_WIN.
Linux
  • Essential Build Tools
    • Debian / Ubuntu: sudo apt install build-essential pkg-config checkinstall make ninja-build
  • Either:
    • GCC 10 (or newer)
      • Debian / Ubuntu: sudo apt install gcc-10
    • LLVM + Clang 14 (or newer)
      • Debian / Ubuntu: bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" all 14
  • CMake 3.20 (or newer)
    • Debian / Ubuntu: sudo apt install cmake
  • Git
    • Debian / Ubuntu: sudo apt install git
  • Qt 5 or 6
    • Qt5 (StreamFX <0.12, OBS Studio <28.0)
      Debian / Ubuntu: sudo apt install qtbase5-dev qtbase5-private-dev libqt5svg5-dev
    • Qt6 (StreamFX >=0.12, OBS Studio >=28.0)
      Debian / Ubuntu: sudo apt install qt6-base-dev qt6-base-private-dev libqt6svg6-dev
  • FFmpeg
    • Debian / Ubuntu: sudo apt install libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev
  • CURL
    • Debian / Ubuntu: sudo apt install libcurl4-openssl-dev
MacOS
  • MacOS 10.15 (or newer) for x86_64, MacOS 11.0 (or newer) for arm64
  • Xcode 11.x (or newer) for x86_64, Xcode 12.x (or newer) for arm64
  • CMake 3.20 (or newer)
  • Git
  • Compatible OBS Studio Dependencies
    Used for FFmpeg, CURL and other libraries. The file third-party/obs-studio/.github/workflows/main.yml lists the correct version as DEPS_VERSION_MAC.
  • Compatible Qt 5 or 6
    Used for User Interface elements. The file third-party/obs-studio/.github/workflows/main.yml lists the correct version as DEPS_VERSION_WIN and QT_VERSION_MAC.

2. Cloning the Project

Using your preferred tool of choice for git, clone the repository including all submodules into a directory. If you use git directly, then you can clone the entire project with git clone --recursive https://github.com/Xaymar/obs-StreamFX.git obs-streamfx.

3. Configuring with CMake

There are two ways to handle this step, with the GUI variant of CMake and with the command line version of CMake. This guide will focus on the GUI variant, but all the steps below can be done with the command line version as well.

  1. Launch CMake-GUI and wait for it to open.
  2. Click the button named Browse Build and point it at an empty folder. For example, create a folder in the project called build and select that folder.
  3. Click the button named Browse Source and point it at the project itself.
  4. Click the button named Configure, select your preferred Generator (the default is usually fine), and wait for it to complete. This will most likely result in an error which is expected.
  5. Adjust the variables in the variable list as necessary. Take a look at the documentation for what each option does.
    • libobs_DIR should point at a precompiled version of the OBS Libraries for the target platform.
    • FFmpeg_DIR, CURL_DIR and AOM_DIR should point at the location of the OBS Dependencies matching the target libOBS version.
    • Qt_DIR should point at the location of a compatible Qt version matching the target libOBS version.
  6. Click the button named Generate, which will also run Configure. Both together should succeed if you did everything correctly.
  7. If available, you can now click the button named Open Project to immediately jump into your IDE of choice.

Available CMake Options

The StreamFX project is extremely configurable and allows you to create tailored versions just for your own experience. Note that many options will be prefixed by StreamFX_ if the build is detected to be of the Bundled variety in order to avoid collisions.

Generic

  • GIT
    Path to the git binary on your system, for use with features that require git during configuration and generation.
  • VERSION
    Set or override the version of the project with a custom one. Allowed formats are: SemVer 2.0.0, CMake.
  • ENABLE_CODESIGN
    Enable code signing integration on supported platforms.
  • ENABLE_CLANG
    Enable integration of clang-format and clang-tidy

Dependencies

  • LibObs_DIR
    Path to the obs-studio libraries.
  • Qt5_DIR, Qt6_DIR or Qt_DIR (autodetect)
    Path to Qt5 (OBS Studio 27.x and lower) or Qt6 (OBS Studio 28.x and higher).
  • FFmpeg_DIR
    Path to compatible FFmpeg libraries and headers.
  • CURL_DIR
    Path to compatible CURL libraries and headers.
  • AOM_DIR
    Path to compatible AOM libraries and headers.

Compiling

  • ENABLE_FASTMATH
    Enable fast math optimizations if the compiler supports them. This trades precision for performance, and is usually good enough anyway.
  • ENABLE_LTO
    Enable link time optimization for faster binaries in exchange for longer build times.
  • ENABLE_PROFILING
    Enable CPU and GPU profiling code, this option reduces performance drastically.
  • TARGET_*
    Specify which architecture target the generated binaries will use.

Features

  • ENABLE_ENCODER_AOM_AV1
    Enable the AOM-AV1 encoder feature.
  • ENABLE_ENCODER_FFMPEG
    Enable the FFmpeg encoder feature.
  • ENABLE_ENCODER_FFMPEG_AMF
    Enable the AMF provider for the FFmpeg encoder feature.
  • ENABLE_ENCODER_FFMPEG_DNXHR
    Enable the DNxHR provider for the FFmpeg encoder feature.
  • ENABLE_ENCODER_FFMPEG_NVENC
    Enable the NVENC provider for the FFmpeg encoder feature.
  • ENABLE_ENCODER_FFMPEG_PRORES
    Enable the ProRes provider for the FFmpeg encoder feature.
  • ENABLE_FILTER_AUTOFRAMING
    Enable the Auto-Framing filter feature.
  • ENABLE_FILTER_AUTOFRAMING_NVIDIA
    Enable the NVIDIA provider for the Auto-Framing filter feature.
  • ENABLE_FILTER_BLUR
    Enable the Blur filter feature.
  • ENABLE_FILTER_COLOR_GRADE
    Enable the Color Grading filter feature.
  • ENABLE_FILTER_DENOISING
    Enable the Denoising filter feature.
  • ENABLE_FILTER_DENOISING_NVIDIA
    Enable the NVIDIA provider for the Denoising filter feature.
  • ENABLE_FILTER_DYNAMIC_MASK
    Enable the Dynamic Mask filter feature.
  • ENABLE_FILTER_SDF_EFFECTS
    Enable the SDF Effects filter feature.
  • ENABLE_FILTER_SHADER
    Enable the Shader filter feature.
  • ENABLE_FILTER_TRANSFORM
    Enable the 3D Transform filter feature.
  • ENABLE_FILTER_UPSCALING
    Enable the Upscaling filter feature.
  • ENABLE_FILTER_UPSCALING_NVIDIA
    Enable the NVIDIA provider for the Upscaling filter feature.
  • ENABLE_FILTER_VIRTUAL_GREENSCREEN
    Enable the Virtual Greenscreen filter feature.
  • ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA
    Enable the NVIDIA provider for the Virtual Greenscreen filter feature.
  • ENABLE_SOURCE_MIRROR
    Enable the Source Mirror source feature.
  • ENABLE_SOURCE_SHADER
    Enable the Shader source feature.
  • ENABLE_TRANSITION_SHADER
    Enable the Shader transition feature.
  • ENABLE_FRONTEND
    Enable the OBS Studio front-end integration.
  • ENABLE_UPDATER
    Enable the Auto-Updater integration, works much better if ENABLE_FRONTEND is also enabled.

Installing

These options are only available in Standalone mode.

  • CMAKE_INSTALL_PREFIX
    The path in which installed content should be placed when building the install target.
  • STRUCTURE_PACKAGEMANAGER
    If enabled will install files in a layout compatible with package managers.
  • STRUCTURE_UNIFIED
    Enable to install files in a layout compatible with an OBS Studio plugin manager.

Packaging

These options are only available in Standalone mode.

  • PACKAGE_NAME
    The name of the packaged archive, excluding the prefix, suffix and extension.
  • PACKAGE_PREFIX
    The path in which the packages should be placed.
  • PACKAGE_SUFFIX
    The suffix to attach to the name, before the file extension. If left blank will attach the current version string to the package.
  • STRUCTURE_UNIFIED
    Enable to replace the PACKAGE_ZIP target with a target that generates a single .obs file instead.

Notes

  • As it was starting to show its age and lack of flexibility, the "Auto-Dependency" system was replaced with proper scripts in v0.12 and beyond. These scripts can handle far more than the integrated system could, with less impact as well.
⚠️ **GitHub.com Fallback** ⚠️