Debian OBS Studio Build Mini-HOWTO

jebba

Member
Hello humans,

Below is a mini HOWTO build OBS Studio using Debian stable (version 12/Bookworm) using some latest/greatest versions by adding the Deb Multimedia repo. This includes a newer FFMPEG and other libraries.

First the Deb Multimedia repo needs to be installed (Note: this may include some non-free software, but I don't think so).
Install Deb Multimedia Keyring:

Bash:
wget https://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.8.1_all.deb
sudo dpkg -i deb-multimedia-keyring_2016.8.1_all.deb

Add a new source for APT:

Bash:
sudo $(EDITOR) /etc/apt/sources.list.d/deb-multimedia.list

Add these lines for the new repo:

Bash:
deb http://www.deb-multimedia.org bookworm main
#deb http://www.deb-multimedia.org bookworm main non-free
deb http://www.deb-multimedia.org bookworm-backports main

Then update your system with newer packages from the Deb Multimedia repo:

Bash:
sudo apt update
sudo apt upgrade

Perhaps also:

Bash:
sudo apt upgrade -t bookworm-backports

Install the OBS Studio build dependencies, now that the Deb Multimedia repo is available.

Bash:
sudo apt install build-essential ccache clang clang-format cmake cmake-curses-gui curl fdkaac fonts-noto \
  fonts-roboto git glslang-dev glslang-tools glslc libasio-dev libasound2-dev libavcodec-dev libavdevice-dev \
  libavfilter-dev libavformat-dev libavutil-dev libcmocka-dev libcurl4-openssl-dev libdrm-dev libfdk-aac-dev \
  libfontconfig-dev libfreetype6-dev libgl1-mesa-dev libgles2-mesa libgles2-mesa-dev libglu1-mesa-dev \
  libglvnd-dev libjack-jackd2-dev libjansson-dev libluajit-5.1-dev libmbedtls-dev libpci-dev libpulse-dev \
  libqrcodegencpp-dev libqt6svg6-dev librist-dev libshaderc-dev libsndio-dev libspeexdsp-dev \
  libsrt-openssl-dev libswresample-dev libswscale-dev libudev-dev libv4l-dev libva-dev libvlc-dev libvpl-dev \
  libwayland-dev libwebsocketpp-dev libx11-dev libx11-xcb-dev libx264-dev libxaw7-dev libxcb1-dev \
  libxcb-composite0-dev libxcb-icccm4-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shm0-dev \
  libxcb-util-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-xinput-dev libxcb-xkb-dev libxcb-xtest0-dev \
  libxcomposite-dev libxinerama-dev libxkbcommon-x11-dev libxkbfile-dev libxres-dev libxss-dev libxtst-dev \
  libxv-dev ninja-build nlohmann-json3-dev pkg-config python3-dev qt6-base-dev qt6-base-private-dev \
  qt6-image-formats-plugins qt6-wayland swig zsh

If you want to use the browser plugin module, you need to get embedded Chrome. It is built from an ancient binary. Good luck rebuilding it from source. The binary that OBS Studio uses (afaik) is available at the link below. Later in the build you'll need to point at where you untarred the cef binary. For example, as user debian, in their home directory.

Bash:
cd
wget https://cdn-fastly.obsproject.com/downloads/cef_binary_5060_linux64.tar.bz2
tar xf cef_binary_5060_linux64.tar.bz2

Now onto actually getting OBS Studio....


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

Find the particular branch or tag that you want:

Bash:
git branch -a
git tag -l | sort -V

Checkout the branch or tag, such as one of:

Bash:
git checkout master
git checkout 30.0.0-beta3
git checkout 29.1.3
git checkout 28.1.2

A bit heavy, but clean out, and update:

Bash:
git reset --hard HEAD
git clean -f -f
git pull
git submodule init
git submodule update

Clear our build directory, if there is one:

Bash:
rm -rf build

The repo is now setup, so configure the build. Change to suit to taste. Also update the update the cef binary path.

Bash:
cmake -S . -B build -G Ninja -DENABLE_PIPEWIRE=0 -DENABLE_BROWSER=1 -DLINUX_PORTABLE=0 -DENABLE_DECKLINK=0 \
  -DENABLE_JACK=1 -DENABLE_SERVICE_UPDATES=0 -DCEF_ROOT_DIR="/home/debian/cef_binary_5060_linux64" \
  -DBUILD_FOR_DISTRIBUTION=1 -DENABLE_ALSA=1 -DENABLE_LIBFDK=1 -DENABLE_PULSEAUDIO=0 \
  -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_SNDIO=0 -DENABLE_WEBRTC=1 -DOAUTH_BASE_URL="http://127.0.0.1" \
  -DCALM_DEPRECATION=ON -DX11_Xaw_INCLUDE_PATH="/usr/include/X11/Xaw" -DENABLE_AJA=1

If you want to go thru the build options more easily with a menu, ccmake (note extra "c") can do it, just use it instead of cmake, such as:

Bash:
ccmake -S . -B build -G Ninja -DENABLE_PIPEWIRE=0 -DENABLE_BROWSER=1 -DLINUX_PORTABLE=0 -DENABLE_DECKLINK=0 \
  -DENABLE_JACK=1 -DENABLE_SERVICE_UPDATES=0 -DCEF_ROOT_DIR="/home/debian/cef_binary_5060_linux64" \
  -DBUILD_FOR_DISTRIBUTION=1 -DENABLE_ALSA=1 -DENABLE_LIBFDK=1 -DENABLE_PULSEAUDIO=0 \
  -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_SNDIO=0 -DENABLE_WEBRTC=1 -DOAUTH_BASE_URL="http://127.0.0.1" \
  -DCALM_DEPRECATION=ON -DX11_Xaw_INCLUDE_PATH="/usr/include/X11/Xaw" -DENABLE_AJA=1

Then in ccmake, hit "c" twice to get options. Hit "t" for more pages of options. Hit "g" to generate.

Compile it thusly. Nice to have ccache setup as it takes a pretty "long" time to build.

Bash:
cmake --build build -j$(nproc)

After the compile is done, make Debian packages:

Bash:
cmake --build build --target package -j$(nproc)

Then install the Debian package, adjusting to the version number built:

Bash:
ls -lh build/*.deb

sudo dpkg -i build/obs-studio-29.1.3-50-Linux.deb

Mark the package to be held, so it doesn't get upgraded over by the system package:

Bash:
sudo apt-mark hold obs-studio

Make sure all is happy with APT:

Bash:
sudo apt -f install

Then just run OBS Studio like normal (the binary gets put in /usr/bin):

Bash:
obs

Starting with version 30.0.0 (beta3 tested), you will need also do the following before building OBS Studio:

Bash:
sudo apt install libssl-dev
git clone --recursive https://github.com/paullouisageneau/libdatachannel
cd libdatachannel/
rm -rf build
cmake -B build -DUSE_GNUTLS=0 -DUSE_NICE=0 -DCMAKE_BUILD_TYPE=Release
cd build/
make -j$(nproc)
sudo make install

Happy hacking,

-Jeff
 
Last edited:

AaronD

Active Member
Is there an advantage to this over, say, Ubuntu Studio?

UStudio has a low-latency kernel, which makes a big difference, and bunch of media-related things pre-installed and "just working". An outdated version of OBS is one of them.
Then add OBS's official PPA, do the normal update procedure again, and you have the latest version of that. Then you can build your rig.
sudo apt-add-repository ppa:obsproject/obs-studio
 

jebba

Member
I haven't used Ubuntu Studio.

Debian stable "just works" with OBS Studio without changing anything, for most use cases. Just `apt install obs-studio` and it works just fine. It isn't *that* old. Most of the time the absolute latest isn't needed anyway. But if it is, I see Debian Testing already has the most recent one (29.1.3), so it looks like Debian is on top of it. I often run Debian "Testing" on systems--it is usually de facto quite stable. The unstable repo though can definitely get messy and have hard breakages (not that I've seen recently, but it happens afaik).

Realtime kernels are available in Debian, just `apt install linux-image-rt-amd64`, to get a "realtime" kernel (add "-rt"). I use this with OBS and JACK (audio).

Perusing Ubuntu Studio's page, they list Ardour and JACK and other applications that are already in Debian. I do my own build of Ardour too, fwiw, but Debian's works too. I guess I don't see much in Ubuntu Studio that I can't just do in Debian, but I just glanced through their site.
 

AaronD

Active Member
I was just looking at the problems I've had installing stuff in the past - undocumented dependencies that have to be sorted out myself, to name the biggest one - compared to having a team that's already done that AND loaded up a ton of tools that I didn't know I needed until the moment-of and there they were! (Ardour plugins...)

Seems like an awful lot less work to just take something that already works and has far more than I need. You're going to install the OS anyway, so that's the same either way, then just the one tweak for OBS, and you're good to go!
 

jebba

Member
If OBS Studio works for you, that's great! :) Building from source, such as above, is not the recommended option for most users. I tend to take the most difficult path possible (e.g. trying to get AJA Kona 4 + OBS working with Debian, kernel 6.5, nvidia gpu on ppc64le).
 
Top