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).
 

mondain

New Member
Great guide, but I just got stuck on a fresh new install of Debian 12 today; here is the output where I'm blocked:

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

Code:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libavcodec-dev : Depends: libavcodec60 (= 10:6.0.1-dmo0+deb12u1) but 10:6.1.2-dmo0~bpo12+1 is to be installed
 libavfilter-dev : Depends: libavfilter9 (= 10:6.0.1-dmo0+deb12u1) but 10:6.1.2-dmo0~bpo12+1 is to be installed
 libavformat-dev : Depends: libavformat60 (= 10:6.0.1-dmo0+deb12u1) but 10:6.1.2-dmo0~bpo12+1 is to be installed
 libavutil-dev : Depends: libavutil58 (= 10:6.0.1-dmo0+deb12u1) but 10:6.1.2-dmo0~bpo12+1 is to be installed
 libpostproc-dev : Depends: libpostproc57 (= 10:6.0.1-dmo0+deb12u1) but 10:6.1.2-dmo0~bpo12+1 is to be installed
 libswresample-dev : Depends: libswresample4 (= 10:6.0.1-dmo0+deb12u1) but 10:6.1.2-dmo0~bpo12+1 is to be installed
 libswscale-dev : Depends: libswscale7 (= 10:6.0.1-dmo0+deb12u1) but 10:6.1.2-dmo0~bpo12+1 is to be installed
 libx264-dev : Depends: libx264-164 (= 4:0.164.3107+gita8b68eb-dmo1) but 4:0.164.3191+git4613ac3-dmo0~bpo12+1 is to be installed
E: Unable to correct problems, you have held broken packages.
 

jebba

Member
It may be that ffmpeg related libraries have changed some names again.

I can point to a few things to help you resolve this. First, running this may give better insight into the issue:

Code:
sudo apt -f install

I also have some updated notes here, but you'd have to dig through the weeds a bit:


I am working on a much more complete documentation of my setup, but it is just in draft form. I don't have the OBS part done yet. Maybe I'll make some further progress someday. That is located here:


Attached to this post is a file "dpkg-list.txt" that has the current list of packages I have installed on by Debian 12.6 (bookworm) system I use for building OBS Studio. Perhaps using that as a reference will help you track down the issue.

Hope this helps and feel free to ping me with more questions if you have any!

Happy hacking,

-Jeff
 

Attachments

  • dpkg-list.txt
    377.4 KB · Views: 28

mondain

New Member
It may be that ffmpeg related libraries have changed some names again.

I can point to a few things to help you resolve this. First, running this may give better insight into the issue:

Code:
sudo apt -f install

I also have some updated notes here, but you'd have to dig through the weeds a bit:


I am working on a much more complete documentation of my setup, but it is just in draft form. I don't have the OBS part done yet. Maybe I'll make some further progress someday. That is located here:


Attached to this post is a file "dpkg-list.txt" that has the current list of packages I have installed on by Debian 12.6 (bookworm) system I use for building OBS Studio. Perhaps using that as a reference will help you track down the issue.

Hope this helps and feel free to ping me with more questions if you have any!

Happy hacking,

-Jeff
Thanks for the prompt response @jebba I'll dig into this tomorrow!
 

Unicorn-1

New Member
@jebba hey there thanks for posting this!

I went through everything and found some things I was able to resolve,

sudo apt install libfreetype6-dev
throws error because the repo was dropped, so replace with `libfreetype-dev` (which has been updated to replace libfreetype6-dev)

ffmpeg 6.1 or higher required to build from * master without specifying version (current defaults to latest beta 31.0.0-beta1)
solution was easy I chose the next previous 30.2.3 that builds with my ffmpeg 6.0.1 version,

however I hit a wall I cannot pass trying to build (on Raspberry Pi Compute Module CM4, Debian 12 Bookworm) with the omission of libvpl-dev, which is apparently only available for AMD processor. I have searched for a replacement or workaround (I'm sure there is a way, possibly reverse engineer and build an arm64 libvpl-dev from scratch maybe...) and nothing I am able find readily available or very much information about libvpl or libvpl-dev (regards to a substitute anyway). I read on another forum somewhere this is the holdup for others also trying to build from source on raspberry pi, yet supposedly it can be installed directly with pi-apps (doesn't run on my CM4 though) so it is possible... I wonder how sudo apt install obs-studio or pi-apps gets around the libvpl problem? and could those solutions be applied to the build dependencies?

I have every possible addition to package repos...

sudo apt-get update
Hit:1 http://http.kali.org/kali kali-rolling InRelease
Get:2 https://raw.githubusercontent.com/clockworkpi/apt/main/debian stable InRelease [5,408 B]
Get:3 https://pkgs.tailscale.com/stable/raspbian bookworm InRelease
Hit:4 http://http.re4son-kernel.com/re4son kali-pi InRelease
Hit:5 https://ftp.debian.org/debian bookworm InRelease
Get:6 https://ftp.debian.org/debian bookworm-updates InRelease [55.4 kB]
Hit:7 https://ftp.debian.org/debian bookworm-proposed-updates InRelease
Hit:8 https://ftp.debian.org/debian bookworm-backports InRelease
Hit:9 http://www.deb-multimedia.org bookworm InRelease
Hit:10 http://www.deb-multimedia.org bookworm-backports InRelease
Fetched 67.4 kB in 7s (9,464 B/s)
Reading package lists... Done

but the missing VPL not made as yet that I'm aware for arm64 doesn't seem available from any of them.

the build error verbose I see is:

CMake Error at /usr/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
Could NOT find VPL (missing: VPL_LIBRARY VPL_INCLUDE_DIR) (Required is at
least version "2.6")
Call Stack (most recent call first):
/usr/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindVPL.cmake:79 (find_package_handle_standard_args)
plugins/obs-qsv11/cmake/legacy.cmake:13 (find_package)
cmake/Modules/ObsHelpers.cmake:473 (include)
plugins/obs-qsv11/CMakeLists.txt:3 (legacy_check)
 

Unicorn-1

New Member
Update: removed build file and switched repo to version 29.1.3 and seem to have gotten past libvpl, only to hit another snag w browser, working on it...
 

EA7

New Member
Same here on a Pi 5 Bookworm - No Browser !
That's Debian for you. Perhaps the answer will be to install Ubuntu or another...
 

jebba

Member
Same here on a Pi 5 Bookworm - No Browser !
That's Debian for you. Perhaps the answer will be to install Ubuntu or another...

What do you mean by no browser? I see both firefox and chromium for ARM64 in debian. Or do you mean built into OBS? I haven't tried to build OBS for Pi.
 
Top