Question / Help OBS Raspberry Pi Build Instructions

TheMindVirus

New Member
Hi MindVirus, thanks a lot for this script. It works on my Pi 4 just fine when I run OBS from the terminal with the GL version override.

One unforeseen consequence which I think has resulted from this is that my Alesis Core 1 audio interface is now no longer properly recognised by the pi. It appears in the list of audio inputs and outputs, but I can no longer adjust the volume in software the way I did before, and when using it to make recordings (e.g. in audacity) the sound is either not there or is hugely distorted. As a result, I currently can't use OBS as I had hoped: to get sound from an external mixer and video from a USB webcam.

I'm wondering if maybe some of those sound library/codec installs in the bash script have overwritten something unfortunate?
I would say if you are having issues with other hardware then reinstalling the drivers after you install OBS Studio and VLC Media Player may help with this. It is likely your Alesis Core 1 is using in-built Linux encoders which are then also used by OBS and might not work simultaneously. I'd like to hear what happens after you reinstall it (and perhaps keep a backup handy in case anything goes wrong).
 

aRBemo58

New Member
Thanks for this info, I got it running on a PI3B with no issues other than performance, this was a proof of concept and I will now do it on my PI4. Great work!
 

TheMindVirus

New Member
Thanks for this info, I got it running on a PI3B with no issues other than performance, this was a proof of concept and I will now do it on my PI4. Great work!
I'm so glad it worked for you!
The interesting thing about the Pi4 is that it has hardware encoders (1080p30Hz) on the board, but the software does not support them directly yet. Since there's no NVidia "NVENC" or similar option for Pi, we have to use software x264 encoding (limited to 720p20Hz).
 

nmaas87

New Member
@TheMindVirus Hi there, I am still struggling in getting the Browser Plugin in OBS working. Recently I found within the testing Repos of Raspbian packages of OBS, even a recent 25.0.3 version - but they seem to mixed it up and compiled it with CEF x64, so it segfaults at launch. And no one seems to be interested in supporting it, so my post has not gotten any answers ( https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=271432 ).

Could you maybe help out with building the OBS 25.x with the Browser Plugin on RPi 4 / Raspbian? This plugin is the last thing I need to get my setup fully working :).

Thanks a lot :)!
 

TheMindVirus

New Member
@TheMindVirus Hi there, I am still struggling in getting the Browser Plugin in OBS working. Recently I found within the testing Repos of Raspbian packages of OBS, even a recent 25.0.3 version - but they seem to mixed it up and compiled it with CEF x64, so it segfaults at launch. And no one seems to be interested in supporting it, so my post has not gotten any answers ( https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=271432 ).

Could you maybe help out with building the OBS 25.x with the Browser Plugin on RPi 4 / Raspbian? This plugin is the last thing I need to get my setup fully working :).

Thanks a lot :)!
I have got somewhere with this, but there are still a lot of bugs to fix in the in-built obs-browser plugin.

This is my script to download and build libcef.so and libcef_dll_wrapper.a:
Code:
#!/bin/bash
#File: install-libcef.sh (sudo chmod +x install-libcef.sh)
#!!! Please run from /home/pi/Downloads (cd /home/pi/Downloads)

LIBCEF_URL_DIR=http://opensource.spotify.com/cefbuilds/
LIBCEF_ARM_BUILD=cef_binary_81.3.1%2Bgb2b49f1%2Bchromium-81.0.4044.113_linuxarm_minimal
LIBCEF_EXTENSION=.tar.bz2
LIBCEF_NAME=libcef
LIBCEF_COMP_NAME=$LIBCEF_NAME$LIBCEF_EXTENSION
LIBCEF_URL=$LIBCEF_URL_DIR$LIBCEF_ARM_BUILD$LIBCEF_EXTENSION
INSTALL_DIR=/usr/lib/
sudo wget -O $LIBCEF_COMP_NAME $LIBCEF_URL
sudo mkdir $LIBCEF_NAME && cd $LIBCEF_NAME
sudo tar -xjvvvf ../$LIBCEF_COMP_NAME --strip-components=1
sync
cd $LIBCEF_NAME
sudo mkdir build && cd build
sudo cmake -G "Unix Makefiles" -DPROJECT_ARCH=arm -DCMAKE_BUILD_TYPE=Release ..
sudo make -j4

exit 0
Then to build OBS with the browser plugin enabled, replace the cmake line with this:

Code:
#should at this point be in .../obs-studio/build
sudo cmake -DCEF_ROOT_DIR="/home/pi/Downloads/libcef" -DBUILD_BROWSER=1 -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr ..
#sudo make -j4
Like I said, it doesn't build properly yet. There are still error messages being generated and the process stops at the linking stage (70%).
 

nmaas87

New Member
Thank you @TheMindVirus and @dodgepong - I tried to build it with CEF 3945, which is the oldest version available for ARM... sadly it did not work out. Is there anything planed to get OBS Browser to a newer CEF version?

Thank you very much!
 

dodgepong

Administrator
Forum Admin
CEF has a couple bugs that have prevented us from shipping with a newer version. One those get resolved we will be happy to update.
 

TheMindVirus

New Member
I'm working on building CEF 3809 with a new build script that should work on Raspbian Desktop x86 with 40GB, to cross compile for Raspbian Pi armhf. It's taking a long time to download (!) and certain packages have been renamed from the legacy instructions. I'll let you know if it works.
 

Spacecowboy121

New Member
Hey guys. I was reading this looks very cool. I was reading around. FFMpeg has encoder support for h264. aka h264_omx. So it should be possible to get OBS to use hardware encoding if we can get it to see the correct ffmpeg. Has anyone looked into this yet? If not I might have a go.
 

TheMindVirus

New Member
Hey guys. I was reading this looks very cool. I was reading around. FFMpeg has encoder support for h264. aka h264_omx. So it should be possible to get OBS to use hardware encoding if we can get it to see the correct ffmpeg. Has anyone looked into this yet? If not I might have a go.
By all means go ahead. The ffmpeg package seems to already be installed in Raspbian by default, so all there needs to be is an OBS plugin which knows how to use h264_omx as an encoder option.
 

TheMindVirus

New Member
The ffmpeg option is "-c:v h264_omx", this is an optional extra command line argument that OBS should optionally pass to ffmpeg to get it to use the encoders.
 

TheMindVirus

New Member

Spacecowboy121

New Member
Still working on the libcef build for obs-linuxbrowser. For the h264_omx support, a good place to start is to look at the obs-ffmpeg plugin folder in plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c. There's nvenc in there too but a new file needs to be created to add OpenMAX (omx) support.
Headers are available from:
- https://github.com/FFmpeg/FFmpeg -> libavcodec -> omx.c
- https://github.com/popcornmix/omxplayer
- https://github.com/obsproject/obs-studio -> plugins -> obs-ffmpeg
Sweet! Thanks for the info. I'll take a look.
 

TheMindVirus

New Member
Have you tried referencing how CI builds OBS on Ubuntu with obs-browser? It might offer some hints. https://github.com/obsproject/obs-studio/blob/master/.github/workflows/main.yml#L234-L336
Mostly the issues I'm facing are related to old versions of projects only being aware of x86 and x64 rather than arm and arm64. (Despite selecting the project architecture as arm it still tries to include SSE2, which should become NEON). Building it manually on x86 seems to work fine. CEF 4103 and 4044 seem to be stable builds and they call all previous versions legacy builds. Maybe newer versions will work with some minor renaming in obs-browser source.
 

Tuna

Member
The ffmpeg package seems to already be installed in Raspbian by default, so all there needs to be is an OBS plugin which knows how to use h264_omx as an encoder option.
If you feel adventurous you may want to try the "obs-gstreamer" plugin found in the plugins section. The HEAD of master should give you options to use GStreamer encoders as OBS encoders. (It requires GStreamer and GStreamer OMX plugins installed of course)

I know some guy made it work on a Tegra which also uses OMX encoder. The implementation on Tegra and Pi are different though and since I don't have either platform there may be some oopsies that may prevent it from working out of the box (never got someone to test drive it) - but should be fixable with very minor changes (if someone reports them).
 
Top