Question / Help OBS Raspberry Pi Build Instructions

v-s

New Member
According to my knowledge the Pi does not support any OpenGL profile. It only supports OpenGL ES profiles (that is a fundamental difference). So there is no OBS version that does OpenGL ES.

So unless one of these things change:
1. OBS ported to run on OpenGL ES contexts
2. The Pi gets an OpenGL (on top of OpenGL ES) driver

The Pi is not a good OBS platform atm - despite its popularity.

I'm not deep into the Pi ecosystem, so there may be patches or development work around these things, but I cannot tell. But from my knowledge out of the box only software fallback will work, with great performance penalty.
I am no OpenGL expert, just a normal user of Linux.

I came across this: https://www.raspberryconnect.com/projects/35-games/142-trying-out-opengl-on-raspberry-pi-3

It says that OpenGL runs at 60fps on test? I just got my rpi4 two days ago so haven't yet tried to compile OBS into it, but perhaps someone could comment on the above website? Again, I'm a simple Linux user so I have no idea about OpenGL and OpenGL ES.

 

jcmcharro

New Member
Hi you all...
I've tried to build OBS with this script https://github.com/xbelanch/OBS4Pi in a PI 4B with a fresh new burned and updated Rapberry OS, but I'm getting this error:


Code:
[ 43%] Building CXX object plugins/obs-vst/CMakeFiles/obs-vst.dir/linux/VSTPlugin-linux.cpp.o
[ 44%] Building CXX object plugins/obs-vst/CMakeFiles/obs-vst.dir/linux/EditorWidget-linux.cpp.o
[ 44%] Linking CXX shared module obs-vst.so
[ 44%] Built target obs-vst
[ 45%] Built target image-source
[ 46%] Built target obs-x264-util
Scanning dependencies of target obs-x264
[ 46%] Building C object plugins/obs-x264/CMakeFiles/obs-x264.dir/obs-x264.c.o
[ 47%] Building C object plugins/obs-x264/CMakeFiles/obs-x264.dir/obs-x264-plugin-main.c.o
[ 47%] Linking C shared module obs-x264.so
[ 47%] Built target obs-x264
Scanning dependencies of target obs-x264-test
[ 47%] Building C object plugins/obs-x264/CMakeFiles/obs-x264-test.dir/obs-x264-test.c.o
[ 47%] Linking C executable obs-x264-test
[ 47%] Built target obs-x264-test
[ 48%] Built target obs-libfdk
[ 48%] Building C object plugins/obs-ffmpeg/CMakeFiles/obs-ffmpeg.dir/obs-ffmpeg-output.c.o
/tmp/tmp.7gpU6AfJaQ/FFmpeg/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c: In function ‘new_stream’:
/tmp/tmp.7gpU6AfJaQ/FFmpeg/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:82:9: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  *codec = (!!name && *name) ? avcodec_find_encoder_by_name(name)
         ^
/tmp/tmp.7gpU6AfJaQ/FFmpeg/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c: In function ‘init_streams’:
/tmp/tmp.7gpU6AfJaQ/FFmpeg/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:374:27: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  AVOutputFormat *format = data->output->oformat;
                           ^~~~
/tmp/tmp.7gpU6AfJaQ/FFmpeg/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c: In function ‘open_output_file’:
/tmp/tmp.7gpU6AfJaQ/FFmpeg/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:395:27: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  AVOutputFormat *format = data->output->oformat;
                           ^~~~
/tmp/tmp.7gpU6AfJaQ/FFmpeg/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c: In function ‘get_codec_id’:
/tmp/tmp.7gpU6AfJaQ/FFmpeg/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:539:8: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  codec = avcodec_find_encoder_by_name(name);
        ^
/tmp/tmp.7gpU6AfJaQ/FFmpeg/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c: In function ‘set_encoder_ids’:
/tmp/tmp.7gpU6AfJaQ/FFmpeg/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:548:37: error: assignment of member ‘video_codec’ in read-only object
  data->output->oformat->video_codec = get_codec_id(
                                     ^
/tmp/tmp.7gpU6AfJaQ/FFmpeg/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:551:37: error: assignment of member ‘audio_codec’ in read-only object
  data->output->oformat->audio_codec = get_codec_id(
                                     ^
/tmp/tmp.7gpU6AfJaQ/FFmpeg/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c: In function ‘ffmpeg_data_init’:
/tmp/tmp.7gpU6AfJaQ/FFmpeg/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:573:34: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  AVOutputFormat *output_format = av_guess_format(
                                  ^~~~~~~~~~~~~~~
/tmp/tmp.7gpU6AfJaQ/FFmpeg/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:600:38: error: assignment of member ‘video_codec’ in read-only object
   data->output->oformat->video_codec = AV_CODEC_ID_H264;
                                      ^
/tmp/tmp.7gpU6AfJaQ/FFmpeg/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:601:38: error: assignment of member ‘audio_codec’ in read-only object
   data->output->oformat->audio_codec = AV_CODEC_ID_AAC;
                                      ^
/tmp/tmp.7gpU6AfJaQ/FFmpeg/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c: In function ‘receive_video’:
/tmp/tmp.7gpU6AfJaQ/FFmpeg/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:728:2: warning: ‘av_init_packet’ is deprecated [-Wdeprecated-declarations]
  av_init_packet(&packet);
  ^~~~~~~~~~~~~~
In file included from /usr/local/include/libavcodec/bsf.h:30,
                 from /usr/local/include/libavcodec/avcodec.h:44,
                 from /usr/local/include/libavformat/avformat.h:312,
                 from /tmp/tmp.7gpU6AfJaQ/FFmpeg/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.h:5,
                 from /tmp/tmp.7gpU6AfJaQ/FFmpeg/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:25:
/usr/local/include/libavcodec/packet.h:474:6: note: declared here
 void av_init_packet(AVPacket *pkt);
      ^~~~~~~~~~~~~~
make[2]: *** [plugins/obs-ffmpeg/CMakeFiles/obs-ffmpeg.dir/build.make:102: plugins/obs-ffmpeg/CMakeFiles/obs-ffmpeg.dir/obs-ffmpeg-output.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1628: plugins/obs-ffmpeg/CMakeFiles/obs-ffmpeg.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

All done..........!
Remember you need MESA_GL_VERSION_OVERRIDE=3.3 obs to start OBS!
If you get an opengl seg fault try to fix it with
export LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libGL.so
before launch OBS

Read the README.md for more information
build.sh: 1: build.sh: cleanup: not found
Don't know how to solve it... any suggestions?
Thanks in advance.
 

dbbarron

New Member
I am a Linux NOOB and am trying to install OBS on a pi4 4gb.
I used the install script posted at the beginning of this forum, but the script errors out near the end based on WAYLAND missing. Can someone advise how to fix this?

- Scripting: Luajit supported
-- Scripting: Python 3 supported
-- Found SWIG: /usr/bin/swig3.0 (found suitable version "3.0.12", minimum required is "2")
-- Using system Jansson library
-- XCB[XCB]: Found component XCB
-- Found XCB: /usr/lib/arm-linux-gnueabihf/libxcb.so found components: XCB
-- Found X11_XCB: /usr/lib/arm-linux-gnueabihf/libX11-xcb.so
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find Wayland (missing: WAYLAND_LIBRARIES WAYLAND_INCLUDE_DIRS)
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindWayland.cmake:76 (find_package_handle_standard_args)
libobs-opengl/CMakeLists.txt:55 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/pi/Downloads/obs-studio/build/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target 'install'. Stop.
installobs.sh: line 18: obs: command not found
pi@raspberrypi:~/Downloads $
 

bradpeterson

New Member
I thought I'd give my experience on a RP4 with a default Ubuntu build (20.04 64-bit).

Earlier the instructions indicated:
Code:
sudo wget http://ftp.uk.debian.org/debian/pool/non-free/f/fdk-aac/libfdk-aac1_0.1.4-2+b1_armhf.deb
sudo wget http://ftp.uk.debian.org/debian/pool/non-free/f/fdk-aac/libfdk-aac-dev_0.1.4-2+b1_armhf.deb
sudo dpkg -i libfdk-aac1_0.1.4-2+b1_armhf.deb
sudo dpkg -i libfdk-aac-dev_0.1.4-2+b1_armhf.deb
However, that didn't work as I had a 64-bit machine. I changed it to:
Code:
sudo wget http://ftp.uk.debian.org/debian/pool/non-free/f/fdk-aac/libfdk-aac1_0.1.4-2+b1_arm64.deb
sudo wget http://ftp.uk.debian.org/debian/pool/non-free/f/fdk-aac/libfdk-aac-dev_0.1.4-2+b1_arm64.deb
sudo dpkg -i libfdk-aac1_0.1.4-2+b1_arm64.deb
sudo dpkg -i libfdk-aac-dev_0.1.4-2+b1_arm64.deb
I also got an OBS/Qt5 error
Code:
Target "obs" links to target "Qt5::GuiPrivate" but the target was not
found.  Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
That was fixed with:
Code:
sudo apt-get install  qtbase5-private-dev
 

bradpeterson

New Member
The Ubuntu 20.04 route ended up being a bit too heavy on processor usage for my liking. I went back to the Raspian build. Seems the main post needs four tweaks:

1) Raspian runs X11, but OBS wants Wayland libraries (dbbarron, this will fix your bug you ran into).
2) Also, OBS uses Pipewire now. I wasn't able to find the right Pipewire packages, so I just disabled Pipewire.
3) OBS uses the CEF tool for Chromium browser support, so I diabled that.
4) OBS build complains about Qt5-GuiPrivate, so I installed that. Below are the tweaks:

Two more packages to add to the apt-get line:
Code:
sudo apt-get install libwayland-dev qtbase5-private-dev
Disabling two things on the OBS build itself:
Code:
sudo cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_PIPEWIRE=OFF -DBUILD_BROWSER=OFF
 

bradpeterson

New Member
Worked for me, thanks :)!
Glad it helps. Just an update on my end. I was able to max out to 28 frames per second at 720p, but only after few tweaks:
  • I used a USB webcam that delivered raw video. If you use a webcam that delivers MJPEG or H264, OBS has to work to decode it, then mix video/audio, then re-encode, and you will only get about 2-5 fps if you do this.
  • I overclocked the RP4 using the raspi-config. That gave me about an additional 3-5 fps,
  • Scaled down from 1024 to 720. That gave another 3-5 fps,
  • I disabled that OBS video preview thumbnail, which gave again another 5-7 fps.
For very basic broadcasting, this can work. But you sure feel limited in terms of using the device for anything else during the broadcast and not seeing the viewable preview output.
 

AaronD

Member
Glad it helps. Just an update on my end. I was able to max out to 28 frames per second at 720p, but only after few tweaks:
  • I used a USB webcam that delivered raw video. If you use a webcam that delivers MJPEG or H264, OBS has to work to decode it, then mix video/audio, then re-encode, and you will only get about 2-5 fps if you do this.
  • I overclocked the RP4 using the raspi-config. That gave me about an additional 3-5 fps,
  • Scaled down from 1024 to 720. That gave another 3-5 fps,
  • I disabled that OBS video preview thumbnail, which gave again another 5-7 fps.
For very basic broadcasting, this can work. But you sure feel limited in terms of using the device for anything else during the broadcast and not seeing the viewable preview output.
That explains why my experiments were awful. I didn't have a choice in my input device or format; it had to be an HDMI->USB3 capture, at 1920x1080@30fps. Unless someone comes up with a massive performance boost, on top of what you did, or the RPi foundation releases a version with much better specs than the current-gen Pi4, it seems that that goal from that kind of device just can't work with OBS on a Pi.

But with the right camera, as you mentioned (maybe the RPi official camera can work???), then *maybe* OBS can offer some minor improvements over raspivid or ffmpeg. Probably not much, but if you need them, you need them. And a Pi is a lot smaller and lower power than a laptop or tower!
 

bradpeterson

New Member
it had to be an HDMI->USB3 capture, at 1920x1080@30fps.
A lot of these HDMI to USB captures send in a compressed feed (and usually with 150 ms audio latency). I had a $15 dongle that works great for laptops. But on the RP4, I discovered the $15 unit was sending in the video as compressed MJPG. I switched to a Logitech webcam that supported YUYV raw output, and that did the trick. I know there are products out there which can convert HDMI to raw video, many of which seem really sketchy on Amazon due to product ID hijacking to fake 4+ star ratings. The good ones seem to start at $75, with the one that everyone raves about at $150.

it seems that that goal from that kind of device just can't work with OBS on a Pi.
Ya. If you can find a camera that feeds you a pre-existing audio/video feed, and you don't need to mix any new video/audio into it, then you can skip OBS entirely, and use ffmpeg to stream RTMP and simply set the audio and video codec to copy. I've used ffmpeg for streaming, and it's surprisingly robust. But at this point, the RP4 just turns into a naive rebroadcaster, which isn't bad for the price.

But with the right camera, as you mentioned (maybe the RPi official camera can work???), then *maybe* OBS can offer some minor improvements over raspivid or ffmpeg.
Nah, it's not the camera. A better camera can still at best only feed raw video. The problem lies in the RP4's video hardware encoder. It technically supports 1080p@30fps, but it's using an old dying standard called OMX. Nobody seems to want to support it, not ffmpeg and not OBS. So unless someone writes OMX support into ffmpeg or OBS, your mixing is going to be software driven, not hardware driven. My dream is that a Raspberry Pi 5 comes out with a completely revamped hardware encoder. But h264 is so license encumbered, and h265 is worse, that I bet an RP5 wouldn't touch that route with a 10 foot pole. The cleanest route is just to go straight to AV1 hardware encoding, which in itself is still new enough that many tools just don't support it right.

And a Pi is a lot smaller and lower power than a laptop or tower!
Yes, my dream was a portable broadcaster I hooked up to a simple touch screen. But the RP4 fell bit short for me. So that sent me down a rabbit hole of searching...

I tried going down other RP4 board paths, like the Rock Pi X, UDOO boards, and hackboard 2. But it seems they either have weak GPUs, or they run an Intel 600-series integrated GPU, which some YouTube demonstrations show is also not quite up to the 1080p@30fps challenge. Next up are Intel NUCs, the 10 and 11 gens are nice, but the integrated GPUs still aren't up to the decoding/encoding challenge (and I hear they are quite loud). Past that is the AMD Ryzen Mini PCs which have Vega 10 graphic chips, which apparently do a bit better, but AMD doesn't seem to really consider hardware encoding a high priority. After this point, you're really back at a laptop level. I've been able to get many entry laptops to encode 1080p@30fps without any issues. But the best would be a laptop with an NVIDIA GPU in it.
 
Last edited:

nmaas87

New Member
For very basic broadcasting, this can work. But you sure feel limited in terms of using the device for anything else during the broadcast and not seeing the viewable preview output.
I admit my usecase is streaming an analog PAL ("480p") signal and including some timing information/overlay to the stream.
This works on a RPi 4 (with active cooling) with reasonable enough framerates / stable 25 FPS.
More would be nice, but if you stated down below, the de-/encoder support for the VideoCore is "just not there" - along with the 1080p@30fps limitation which is still included in the RPi 4. This also makes matters worse if you want to use the RPi as VMware View Client, as hardware decoding of displays greater than one display at 1080p is not available, making the RPi 4 NOT a suitable client for 2 Displays @ 4k/30Hz, as everything needs to be decoded by CPU (it works somewhat, but is a bit... "rubberband-feeling").

However, for my original application, I did not find anything better than OBS so I'll keep using that and looking forward, maybe there will be breakthrough somewhen by some person - some years ago we did not think we will ever have OBS on the RPi, so thats already most welcome :)
(.. and the usage as small restreamer boxes or even as HDMI to h.264/h.265 via network would be really invaluable for a lot of different live/convention broadcasting applications :)).
 

nmaas87

New Member
Short update:
Thanks to xbelanchs help I managed to get the OpenMAX Encoder available in OBS as seen on @axu_love screenshot.
However, it seems to be a hoax / not working ;).
Basically, you can build ffmpeg with OpenMAX (omx-enable and omx-enable-rpi), then you just need to build the gst-omx plugin for gstreamer and everything show up like on axus Screenshot. But starting streaming or recording will not work.

Error and documentation within https://github.com/xbelanch/OBS4Pi/issues/15
 

ugobolla

New Member
All right! (I am using RPI4 with the las raspberry os) but when I write:
sudo make install
then I receive this error:
Error "make: *** No rule to make target `install'. Stop.
I attached the log too.
c7f2b928-3590-4ae8-8fee-a2036bc98f18.jpeg
 

Attachments

Bobby_Digital

New Member
Hello, I try to run OBS on Raspberry 4 and Bullseye. But it always ends here:

Error.png

"no destinations were specified and no control file was found."

Maybe someone has a solution for that? Thanks.
 

luisquid

New Member
Hi,

New to Raspberry Pi here, I am getting stuck at the make -j4 command in the termnial. This never completes to 100%

[ 67%] Built target obspython_swig_compilation
[ 67%] Built target glad
[ 67%] Built target media-playback
[ 67%] Built target caption
[ 67%] Built target obslua_swig_compilation
[ 67%] Built target libobs
[ 67%] Built target file-updater
[ 67%] Built target obs-frontend-api
[ 67%] Built target libobs-opengl
[ 67%] Built target linux-capture
[ 67%] Built target linux-pulseaudio
[ 67%] Built target linux-jack
[ 67%] Built target linux-alsa
[ 67%] Built target linux-v4l2
[ 67%] Built target sndio
[ 67%] Built target vlc-video
[ 67%] Automatic MOC for target obs-vst
[ 67%] Built target linux-decklink
[ 67%] Built target obs-vst_autogen
[ 67%] Built target image-source
[ 67%] Built target obs-x264-util
[ 67%] Built target obs-libfdk
[ 67%] Linking C executable obs-ffmpeg-mux
[ 67%] Built target obs-ffmpeg
/usr/bin/ld: cannot open output file obs-ffmpeg-mux: Permission denied
collect2: error: ld returned 1 exit status
make[2]: *** [plugins/obs-ffmpeg/ffmpeg-mux/CMakeFiles/obs-ffmpeg-mux.dir/build.make:88: plugins/obs-ffmpeg/ffmpeg-mux/obs-ffmpeg-mux] Error 1
make[1]: *** [CMakeFiles/Makefile2:1643: plugins/obs-ffmpeg/ffmpeg-mux/CMakeFiles/obs-ffmpeg-mux.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 67%] Built target obs-outputs
[ 67%] Built target obs-filters
[ 67%] Built target obs-transitions
make: *** [Makefile:152: all] Error 2
pi@raspberrypi:~/obs-studio/build $

I am not sure where to go from here any assistance would be greatly appreciated.
Are you using a Raspberry 4 with the default Raspberry OS?
 
Top