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
- Is Thonny or Visual Studio Code better for Raspberry Pi users?
- 7 great ideas using Raspberry Pi as a server
- 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?
- Steps to install and setup Android Studio in Windows
- How to create a file to install Visual Studio offline
Maybe you are interested
Europe develops satellite internet system to replace Starlink
BadBox Malware Is Picking Up Speed, Targeting Certain Android Devices
5 Best Dark Web Browsers for Your Device
Android's new Find Nearby feature helps detect unwanted Bluetooth tracking devices
Why many people choose to use wireless technology, away from wired devices
Google Photos has added the ability to undo device backups