How to install OBS Studio on Raspberry Pi OS
With the new Raspberry Pi models available, video recording and playback have become possible. The Raspberry Pi 4 can handle this quite well.
One of the most used software for video recording on a PC is OBS Studio and can install it on a Raspberry Pi. Let's find out through the following article!
Install OBS Studio
Hardware
OBS Studio is not optimized for Raspberry Pi, there is no release for Pi and there is no specific development for the ARM architecture.
The compilation process can be very long depending on the Raspberry Pi model.
You should use a Raspberry Pi 4 4GB or 8GB on Vilros to follow this guide.
If you want to try it on the Raspberry Pi 3B +, it might work if you create a swap file.
Here's how to create a swap file (in Terminal or via SSH):
sudo dd if=/dev/zero of=/var/swap2 bs=1024 count=1000000 sudo chmod 600 /var/swap2 sudo mkswap /var/swap2 sudo swapon /var/swap2 sudo swapon
Even with the Raspberry Pi 4, the compilation process will use 100% CPU and most memory. So please be patient if you try on another device.

Prerequisites
When the system is ready, you need to install a large list of packages before starting the compilation process.
Copy and paste the following command in Terminal:
sudo apt install build-essential checkinstall cmake git libmbedtls-dev libasound2-dev libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libgl1-mesa-dev libjack-jackd2-dev libjansson-dev libluajit-5.1-dev libpulse-dev libqt5x11extras5-dev libspeexdsp-dev libswresample-dev libswscale-dev libudev-dev libv4l-dev libvlc-dev libx11-dev libx11-xcb1 libx11-xcb-dev libxcb-xinput0 libxcb-xinput-dev libxcb-randr0 libxcb-randr0-dev libxcb-xfixes0 libxcb-xfixes0-dev libx264-dev libxcb-shm0-dev libxcb-xinerama0-dev libxcomposite-dev libxinerama-dev pkg-config python3-dev qtbase5-dev libqt5svg5-dev swig
FFmpeg AAC
Another prerequisite is the FDK AAC package, but no full version is available on Raspbian.
Therefore, the article will be downloaded from the Debian archive and installed manually
FDK AAC is an FFmpeg encoder for the AAC format, inherited from MP3, commonly used in MP4 streams and required for OBS Studio.
Here's how to install it:
- Download these 2 files:
wget http://ftp.debian.org/debian/pool/non-free/f/fdk-aac/libfdk-aac2_2.0.1-1_armhf.deb wget http://ftp.debian.org/debian/pool/non-free/f/fdk-aac/libfdk-aac-dev_2.0.1-1_armhf.deb
- Install them with:
sudo dpkg -i libfdk-aac2_2.0.1-1_armhf.deb sudo dpkg -i libfdk-aac-dev_2.0.1-1_armhf.deb
You are now ready to download and compile the source code
Building the source code
The article will download the source code from the GitHub project.
Follow these steps to download and install everything:
- Download source code with git:
sudo git clone --recursive https://github.com/obsproject/obs-studio.git
You can move to a specific directory if you want (like / opt ). The article has done this in the Downloads folder .
- Move to a new folder:
cd obs-studio
- Create a folder and move to this folder:
sudo mkdir build cd build
- Run cmake:
sudo cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr .
- And finally, start the compilation process:
sudo make -j4
Compile time depends on your hardware, from minutes to an hour.
And here is the final step to install OBS Studio:
sudo make install
OBS is now ready for use
First run
Once installed, you can launch it from the main menu: Sound & Video> OBS Studio.
On first run, the automatic configuration wizard is available to set default settings.
Answer a few questions (you can keep the default values) and OBS will run an experiment to configure everything. Click Apply settings to confirm .
Debugging on Raspberry Pi 4
On Raspberry Pi 4, you cannot run OBS directly.
The author of the article encountered this error:
Failed to initialize video. Your GPU may not be supported, or your graphic drivers may need to be updated.
(Cannot initialize video. The GPU may not be supported or the graphics driver needs updating.)
The only thing that works with the example is setting this variable before starting OBS:
- Open a Terminal.
- Run this command:
MESA_GL_VERSION_OVERRIDE=3.3 obs
Everything will work as expected. You can now run the automatic configuration wizard as explained in the previous step.
You should read it
- How to use Raspberry Pi Imager to install Raspberry Pi OS
- How to start Raspberry Pi 3 from USB
- How to install OBS Studio in Ubuntu
- 10 great projects combining Raspberry Pi and Windows 10 IoT Core
- Learn Pi Imager, How to Use Raspberry Pi Imager
- How to install Android on a Raspberry Pi
- How to add an ADC to Raspberry Pi: What you need to know
- Raspberry Pi Zero vs Model A and B, how are they different?
May be interested
- What is the difference between Raspberry Pi 4 and other models?raspberry pi 4 is a game changer. here's what you need to know about pi 4 and how this model is different from the previous raspberry pi 3b +.
- How to run Doom on Raspberry Pi without emulatorwith the source code available, many new forms of doom games have appeared, including versions for the raspberry pi. today's article will show you how to run doom on a raspberry pi (without an emulator).
- 3 ways to boot multiple operating systems on Raspberry Pivarious options are available for multiboot raspberry pi, depending on the model and preferred storage media. below, how to install multiple raspberry pi operating systems to perform dual boot and multiboot.
- How to turn a Raspberry Pi into a home automation panelin this tutorial, you'll learn how to set up domoticz, a powerful home automation control panel, on the raspberry pi to track, configure, and interact with various smart devices scattered throughout the home.
- How to run the emulator on the Raspberry Pi 4for years, raspberry pi fans have been running game emulation platforms like retropie, recalbox and lakka. however, when the raspberry pi 4 came out, none of these platforms officially supported new hardware, and users had to look for beta versions or alternatives that didn't work very well.
- How to run scripts on boot on the Raspberry Pithere are several ways to automatically start scripts when you boot up a raspberry pi, but the easiest way is to use crontab, a scheduling feature that also allows you to set scripts to run at specific times.