Debian-based Linux distributions and FreeBSD can use automatic build scripts supplied by the project, which can handle dependency installation, building and packaging. Additional build directions are available for other distributions below.

Note: as of May 1, 2019, Facebook live now mandates the use of RTMPS. That functionality requires your distro’s mbed TLS package, which obs-studio/cmake/Modules/FindMbedTLS.cmake script searches for at compile time.

Note: Do not use the GitHub source .tar as it does not include all the required source files. Always use the appropriate Git tag with the associated submodules.

Debian-based build directions

Option A: Automatic Debian builds

Automatic Debian builds allow building OBS with minimal input and setup - necessary dependencies are installed automatically, build flags use a sane default and the generated OBS build uses the application’s full feature set.

Prerequisites

  • Debian Bullseye
  • Git

Build procedure

  • Clone the repository including submodules:

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

  • To do a fully automated build, open Terminal, switch to the checkout directory then run one of the following commands:

  1. # Download and set up dependencies, then build OBS for local host
  2. # architecture with common feature set
  3. CI/build-linux.sh
  4. # Skip download and setup of dendencies
  5. CI/build-linux.sh --skip-dependency-checks
  6. # Show all available options
  7. CI/build-linux.sh --help
  8. # Use `my_build_dir` prefix as build directory
  9. CI/build-linux.sh --build-dir my_build_dir

Option B: Custom Debian builds

Custom Debian builds allow full customization of the desired build configuration but also require manual setup and preparation. Available CMake configuration variables can be found in the CMake build system documentation.

Prerequisites

  • Debian Bullseye
  • CMake 3.16 or newer
  • Git
  • Ninja
  • Optional: CCache to improve compilation speeds on consecutive builds
  • For browser source and browser panel support, the pre-built CEF framework is needed:
    • Chromium Embedded Framework (CEF) x86_64
  • Several additional dependencies (see step 2 below)

Build procedure

1. Get the source code

  1. Open a Terminal window, create and switch to a directory you want to have OBS checked out
  2. Clone the repository including submodules: git clone --recursive https://github.com/obsproject/obs-studio.git

(If you do not know what submodules are, or you are not using Git from the command line, PLEASE make sure to fetch the submodules too.)

2. Get the dependencies

  • To download and set up most preconditions mentioned above, you can also run the script CI/linux/01_install_dependencies.sh from the checkout directory (run it with the --help switch to see all available options).

NOTE: The directory where the script will download and setup the dependencies in cannot be changed.

  • Alternatively the required dependencies can be installed using apt:

    • Build system dependencies

      1. sudo apt install cmake ninja-build pkg-config clang clang-format build-essential curl ccache git
    • OBS dependencies (core):

      1. sudo apt install libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev libx264-dev libcurl4-openssl-dev libmbedtls-dev libgl1-mesa-dev libjansson-dev libluajit-5.1-dev python3-dev libx11-dev libxcb-randr0-dev libxcb-shm0-dev libxcb-xinerama0-dev libxcomposite-dev libxinerama-dev libxcb1-dev libx11-xcb-dev libxcb-xfixes0-dev swig libcmocka-dev libxss-dev libglvnd-dev libgles2-mesa libgles2-mesa-dev libwayland-dev
    • OBS dependencies (UI):

      1. sudo apt install qt6-base-dev qt6-base-private-dev libqt6svg6-dev qt6-wayland
    • If Qt6 is not available:

      1. sudo apt install qtbase5-dev qtbase5-private-dev libqt5svg5-dev qtwayland5
    • Plugin dependencies:

      1. sudo apt install libasound2-dev libfdk-aac-dev libfontconfig-dev libfreetype6-dev libjack-jackd2-dev libpulse-dev libsndio-dev libspeexdsp-dev libudev-dev libv4l-dev libva-dev libvlc-dev libdrm-dev

3. Set up the build project

  1. Run CMake to generate a build environment
  1. cmake -S . -B YOUR_BUILD_DIRECTORY -G Ninja \
  2. -DCEF_ROOT_DIR="../obs-build-dependencies/cef_binary_4638_linux64" \
  3. -DENABLE_PIPEWIRE=OFF \
  4. -DENABLE_AJA=0

Optional Settings:

  1. To enable PipeWire support change -DENABLE_PIPEWIRE to ON
  2. To disable browser source support (e.g. for 32-bit builds) set -DENABLE_BROWSER to OFF
  3. To change the build type, pass either Debug, Release, RelWithDebInfo, or MinSizeRel as -DCMAKE_BUILD_TYPE

NOTE: When building OBS with LINUX_PORTABLE disabled, OBS expects GNU-based install paths (e.g. /usr/local/[bin,lib,share]) and is built for a single architecture only. To create separate builds for 32-bit and 64-bit architectures, always enable portable builds.

4. Build the project

  1. Run cmake --build YOUR_BUILD_DIRECTORY to build the entire OBS project
  2. Run cmake --build YOUR_BUILD_DIRECTORY -t libobs to build only libobs or any other valid target
  3. Run cmake --build YOUR_BUILD_DIRECTORY -t clean to clean your current build directory

6. Install the project

Installation will use the directory specified via -DCMAKE_INSTALL_PREFIX or can be customised with the --prefix switch:

  1. Run cmake --install YOUR_BUILD_DIRECTORY to install OBS to the prefix the project was configured with
  2. Run cmake --install YOUR_BUILD_DIRECTORY --prefix to install OBS to a custom location

7. Create Debian package

  1. Run cmake --build YOUR_BUILD_DIRECTORY --target package - CMake will handle all operations necessary to create a .deb package archive, including necessary dependencies.

Red Hat-based

  • Get RPM Fusion at http://rpmfusion.org/Configuration/ (Nux Desktop is an alternative that may include better packages for RHEL/CentOS 7)

  • Get the required packages:

    1. sudo yum install \
    2. alsa-lib-devel \
    3. cmake \
    4. ffmpeg-devel \
    5. fontconfig-devel \
    6. freetype-devel \
    7. gcc \
    8. gcc-c++ \
    9. gcc-objc \
    10. git \
    11. glib2-devel \
    12. libcurl-devel \
    13. libdrm-devel \
    14. libglvnd-devel \
    15. libv4l-devel \
    16. libX11-devel \
    17. libXcomposite-devel \
    18. libXinerama-devel \
    19. luajit-devel \
    20. make \
    21. mbedtls-devel \
    22. pciutils-devel \
    23. pipewire-devel \
    24. pulseaudio-libs-devel \
    25. python3-devel \
    26. qt5-qtbase-devel \
    27. qt5-qtbase-private-devel \
    28. qt5-qtsvg-devel \
    29. qt5-qtwayland-devel \
    30. qt5-qtx11extras-devel \
    31. speexdsp-devel \
    32. swig \
    33. systemd-devel \
    34. vlc-devel \
    35. wayland-devel \
    36. x264-devel
  • Building and installing OBS:

    • If building with browser source:

      1. wget https://cdn-fastly.obsproject.com/downloads/cef_binary_4638_linux64.tar.bz2
      2. tar -xjf ./cef_binary_4638_linux64.tar.bz2
      3. git clone --recursive https://github.com/obsproject/obs-studio.git
      4. cd obs-studio
      5. mkdir build && cd build
      6. cmake -DENABLE_BROWSER=ON -DCEF_ROOT_DIR="../../cef_binary_4638_linux64" -DENABLE_AJA=OFF ..
      7. make -j4
      8. sudo make install
    • If building without browser source:

      1. git clone --recursive https://github.com/obsproject/obs-studio.git
      2. cd obs-studio
      3. mkdir build && cd build
      4. cmake -DENABLE_BROWSER=OFF -DENABLE_AJA=OFF ..
      5. make -j4
      6. sudo make install
  • By default OBS installs libraries in /usr/local/lib. To make sure that the loader can find them there, create a file /etc/ld.so.conf.d/local.conf with the single line

    and then run

    1. sudo ldconfig

Fedora

  • Get the required packages:

    1. sudo dnf install \
    2. alsa-lib-devel \
    3. cmake \
    4. ffmpeg-devel \
    5. fontconfig-devel \
    6. freetype-devel \
    7. gcc \
    8. gcc-c++ \
    9. gcc-objc \
    10. git \
    11. glib2-devel \
    12. libcurl-devel \
    13. libdrm-devel \
    14. libglvnd-devel \
    15. libv4l-devel \
    16. libX11-devel \
    17. libXcomposite-devel \
    18. libXdamage \
    19. libXinerama-devel \
    20. luajit-devel \
    21. make \
    22. mbedtls-devel \
    23. pciutils-devel \
    24. pipewire-devel \
    25. pulseaudio-libs-devel \
    26. python3-devel \
    27. qt5-qtbase-devel \
    28. qt5-qtbase-private-devel \
    29. qt5-qtsvg-devel \
    30. qt5-qtwayland-devel \
    31. qt5-qtx11extras-devel \
    32. speexdsp-devel \
    33. swig \
    34. systemd-devel \
    35. vlc-devel \
    36. wayland-devel \
    37. x264-devel
  • Building and installing OBS:

    • If building with browser source:

      1. wget https://cdn-fastly.obsproject.com/downloads/cef_binary_4638_linux64.tar.bz2
      2. tar -xjf ./cef_binary_4638_linux64.tar.bz2
      3. git clone --recursive https://github.com/obsproject/obs-studio.git
      4. cd obs-studio
      5. mkdir build && cd build
      6. cmake -DENABLE_BROWSER=ON -DCEF_ROOT_DIR="../../cef_binary_4638_linux64" -DENABLE_AJA=OFF ..
      7. make -j$(nproc)
      8. sudo make install
      9. sudo echo "/usr/local/lib" >> /etc/ld.so.conf.d/local.conf
      10. sudo ldconfig
    • If building without browser source:

      1. git clone --recursive https://github.com/obsproject/obs-studio.git
      2. cd obs-studio
      3. mkdir build && cd build
      4. cmake -DENABLE_BROWSER=OFF -DENABLE_AJA=OFF ..
      5. make -j$(nproc)
      6. sudo make install
      7. sudo echo "/usr/local/lib" >> /etc/ld.so.conf.d/local.conf
      8. sudo ldconfig

openSUSE

  • See openSUSE install instructions for details on adding Packman repository.

  • Get the required packages:

    1. sudo zypper in cmake \
    2. fontconfig-devel \
    3. freetype2-devel \
    4. gcc \
    5. gcc-c++ \
    6. libcurl-devel \
    7. ffmpeg2-devel \
    8. libjansson-devel \
    9. libpulse-devel \
    10. libspeexdsp-devel \
    11. libqt5-qtbase-devel \
    12. libqt5-qtx11extras-devel \
    13. libudev-devel \
    14. libv4l-devel \
    15. libXcomposite-devel \
    16. libXinerama-devel \
    17. libXrandr-devel \
    18. luajit-devel \
    19. mbedtls \
    20. swig \
    21. python3-devel \
    22. libxss-dev
  • Building and installing OBS:

    • If building with browser source:

      1. wget https://cdn-fastly.obsproject.com/downloads/cef_binary_4638_linux64.tar.bz2
      2. tar -xjf ./cef_binary_4638_linux64.tar.bz2
      3. git clone --recursive https://github.com/obsproject/obs-studio.git
      4. cd obs-studio
      5. mkdir build && cd build
      6. cmake -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_BROWSER=ON -DCEF_ROOT_DIR="../../cef_binary_4638_linux64" -DENABLE_AJA=OFF ..
      7. make -j4
      8. sudo make install
    • If building without browser source:

      1. git clone --recursive https://github.com/obsproject/obs-studio.git
      2. cd obs-studio
      3. mkdir build && cd build
      4. cmake -DLINUX_PR=1 -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_BROWSER=OFF -DENABLE_AJA=OFF ..
      5. make -j4
      6. sudo make install

Linux portable mode (all distros)

  • Please note that you need to install the build dependencies for your distribution before following this steps. See above.

  • You can build in portable mode on Linux, which installs all the files to an isolated directory.

    • If building with browser source:

      1. wget https://cdn-fastly.obsproject.com/downloads/cef_binary_4638_linux64.tar.bz2
      2. tar -xjf ./cef_binary_4638_linux64.tar.bz2
      3. git clone --recursive https://github.com/obsproject/obs-studio.git
      4. cd obs-studio
      5. mkdir build && cd build
      6. cmake -DLINUX_PORTABLE=ON -DCMAKE_INSTALL_PREFIX="${HOME}/obs-studio-portable" -DENABLE_BROWSER=ON -DCEF_ROOT_DIR="../../cef_binary_4638_linux64" -DENABLE_AJA=OFF ..
      7. make -j4 && make install
    • If building without browser source:

      1. git clone --recursive https://github.com/obsproject/obs-studio.git
      2. cd obs-studio
      3. mkdir build && cd build
      4. cmake -DLINUX_PORTABLE=ON -DCMAKE_INSTALL_PREFIX="${HOME}/obs-studio-portable" -DENABLE_BROWSER=OFF -DENABLE_AJA=OFF ..
      5. make -j4 && make install
  • After that, you should have a portable install in ~/obs-studio-portable. Change to bin/64bit or bin/32bit and then simply run: ./obs