OBS-Studio-32.0.4

#### Supplemental Linux® From Scratch - Version 13.0

### Chapter 12. Graphical Applications

- Prev

  Mesa-Demos-9.0.0

- Next

  slurp-1.5.0

- Up
- Home

# OBS-Studio-32.0.4

## Introduction to OBS Studio

OBS Studio is a screen recorder that can be piped to various media containers and remote servers. It is geared towards streaming but also has a very much supported general recording usecase.

### Note

This may take a while to build. Feel free to do something else while this is building.

- Download: https://github.com/obsproject/obs-studio/releases/download/32.0.4/OBS-Studio-32.0.4-Sources.tar.gz

### Additional Downloads

- Required patch: https://www.linuxfromscratch.org/slfs/view/13.0/download/obs/obs-studio-32.0.4-qt6.10-1.patch

- Recommended download: https://cdn-fastly.obsproject.com/downloads/cef_binary_6533_linux_x86_64.tar.xz

### OBS Studio Dependencies

#### Required

alsa-plugins, CMake, cURL, Extra-CMake-Modules (ECM), FFmpeg, FreeType2, Fontconfig, GLib (with GObject Introspection), Jansson, libdrm, libva, libxkbcommon, Mbed-TLS-3.6.5, OpenGL (libglvnd or Mesa; Mesa's GL is not supported), pciutils, Qt-6, SIMDe-0.8.2, uthash-2.3.0, Vulkan-Loader, Xorg Libraries, and x264

#### Recommended

- asio-1-36-0, QR-Code-generator-1.8.0, and websocketpp-0.8.2 (required for WebSocket support)

- at-spi2-core and Cups (required for browser support)

- CUDA (CUDA or CUDA-r580) and nv-codec-headers (required for NVIDIA hardware encoding)

- fdk-aac (required for FDK AAC codec support)

- intel-media-driver, Intel-MediaSDK-23.2.2 (for GPUs from Broadwell to Tiger Lake), intel-onevpl-26.1.2 (for GPUs from Tiger Lake onward), libvpl-2.16.0, and Mesa (required for Intel QSV11 hardware encoding)

- libdatachannel-0.24.1 (required for WebRTC support)

- Pipewire and xdg-desktop-portal (required for Pipewire camera support and screencasting)

- PulseAudio (required for PulseAudio audio sources)

- Speex (required for SpeexDSP noise suppression)

- SWIG and luajit (required for scripting support)

- v4l-utils (required for V4L support)

- VLC (required for VLC support)

- EGL (libglvnd or Mesa; Mesa's GL is not supported) and Wayland (required for Wayland support)

### Note

The options to disable the functionality enabled by the dependencies above are in the Command Explanations.

#### Optional

Jack2, libajantv2, librist, librnnoise (if not installed, an internal copy will be used), and sndio

## Installation of OBS Studio

Apply a patch to allow building with Qt-6.10.x, above, and below:

    patch -Np1 -i ../obs-studio-32.0.4-qt6.10-1.patch

### Important

If you are on Qt-6.10.x, ensure that it was built with the upstream fixes patch. If it wasn't, any package including this one will crash when using qtdeclarative. This should get fixed in Qt-6.11, which is in beta currently.

If FFmpeg is 8.0 or above, allow the code to build against it:

    if pkgconf --atleast-version 62 libavformat; then
      sed -i 's/FF_/AV_/g' \
        plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c
    fi

If you want to enable browser support, ensure you have downloaded the recommended download, then unpack it:

    tar -xf ../cef_binary_6533_linux_x86_64.tar.xz &&
    mv cef_binary_6533_linux_x86_64 cef-6533

Install OBS Studio by running the following commands:

    mkdir build &&
    cd    build &&

    cmake -D CMAKE_INSTALL_PREFIX=/usr             \
          -D CMAKE_SKIP_INSTALL_RPATH=ON           \
          -D OBS_VERSION_OVERRIDE="32.0.4"         \
          -D ENABLE_BROWSER=ON                     \
          -D CEF_ROOT_DIR=../cef-6533              \
          -D ENABLE_AJA=OFF                        \
          -D ENABLE_JACK=OFF                       \
          -D ENABLE_NEW_MPEGTS_OUTPUT=OFF          \
          -D OBS_COMPILE_DEPRECATION_AS_WARNING=ON \
          -G Ninja -Wno-dev .. &&

    ninja

### Note

Normally for Meson and CMake projects, the build type is set to release. However, doing so for OBS-Studio will cause it to have a segmentation fault as CMake uses Interprocedural Optimization, or IPO, which conflicts with the set build type in unexpected ways. The above setup lets CMake figure it out as to not introduce conflicts.

Now, as the `root` user:

    ninja install

## Command Explanations

`-D CMAKE_SKIP_INSTALL_RPATH=ON`: This switch makes cmake remove hardcoded library search paths (rpath) when installing a binary executable file or a shared library. This package does not need rpath once it's installed into the standard location, and rpath may sometimes cause unwanted effects or even security issues.

`-D OBS_VERSION_OVERRIDE="32.0.4"`: This switch sets the OBS-Studio version properly, which is otherwise set at `0`.

`-D ENABLE_BROWSER=ON`: This switch enables browser support.

`-D CEF_ROOT_DIR=../cef-6533`: This switch tells the build system where the CEF binaries are located.

`-D ENABLE_AJA=OFF`: This switch disables the optional Aja functionality.

`-D ENABLE_JACK=OFF`: This switch disables the optional Jack2 functionality.

`-D ENABLE_NEW_MPEGTS_OUTPUT=OFF`: This switch disables the optional MpegTS Output functionality.

`-D ENABLE_PIPEWIRE=OFF`: Disables Pipewire support if you have not installed it.

`-D ENABLE_SPEEXDSP=OFF`: Disables Speex support if you have not installed it.

`-D ENABLE_WEBRTC=OFF`: Disables WebRTC support if you have not installed the recommended dependencies.

`-D ENABLE_WEBSOCKET=OFF`: Disables WebSocket support if you have not installed the recommended dependencies.

`-D ENABLE_V4L2=OFF`: Disables V4L2 support if you have not installed the recommended dependencies.

`-D ENABLE_VLC=OFF`: Disables VLC support if you have not installed the recommended dependencies.

`-D ENABLE_NVENC=OFF -D ENABLE_NVENC_FFMPEG_IDS=OFF`: These options disable NVIDIA hardware encoding support if you have not installed the recommended dependencies.

`-D ENABLE_QSV11=OFF`: Disables Intel QSV11 hardware encoding support if you have not installed the recommended dependencies.

`-D ENABLE_SCRIPTING=OFF`: Disables scripting support if you have not installed the recommended dependencies.

`-D OBS_COMPILE_DEPRECATION_AS_WARNING=ON`: This ensures there are no build failures due to deprecated features in the FFmpeg side being used.

## Contents

Installed Programs: obs and obs-ffmpeg-mux
Installed Libraries: libobs-frontend-api, libobs-opengl, libobs-scripting, libobs, and many plugins in /usr/lib/obs-plugins
Installed Directories: /usr/include/obs, /usr/lib/cmake/{libobs,obs-frontend-api,obs-websocket-api}, /usr/lib/obs-plugins, /usr/lib/obs-scripting, and /usr/share/obs

### Short Descriptions

obs | is the OBS Studio program
obs-ffmpeg-mux | is the FFmpeg multiplexer that obs uses
`libobs-frontend-api` | contains API functions for the OBS Studio frontend
`libobs-opengl` | provided OpenGL rendering functions for OBS Studio
`libobs-scripting` | provides functions for OBS Studio scripts
`libobs` | contains all the functions used by OBS Studio and its plugins

- Prev

  Mesa-Demos-9.0.0

- Next

  slurp-1.5.0

- Up
- Home