Skip to content

Instantly share code, notes, and snippets.

@shivasiddharth
Last active January 24, 2023 04:46
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save shivasiddharth/b6756dda4a0bc97ff5a0f3854eec668a to your computer and use it in GitHub Desktop.
Save shivasiddharth/b6756dda4a0bc97ff5a0f3854eec668a to your computer and use it in GitHub Desktop.
Script for installing OBS on Raspberry Pi
#!/bin/bash
echo ""
echo "Checking memory size.........."
Totalmem=$(cat /proc/meminfo|grep MemTotal|grep -o '[0-9]*')
if (($Totalmem > 3500000)); then
echo ""
echo "You have got enough memory. No need for a swap partition.........."
echo ""
else
echo ""
echo "Creating swap partition.........."
echo ""
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
fi
echo ""
echo "Compiling FFMPEG.........."
echo ""
sudo apt-get -y install autoconf automake build-essential cmake doxygen git graphviz imagemagick libasound2-dev libass-dev libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libfreetype6-dev libgmp-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libopus-dev librtmp-dev libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev libsdl2-ttf-dev libsnappy-dev libsoxr-dev libssh-dev libssl-dev libtool libv4l-dev libva-dev libvdpau-dev libvo-amrwbenc-dev libvorbis-dev libwebp-dev libx264-dev libx265-dev libxcb-shape0-dev libxcb-shm0-dev libxcb-xfixes0-dev libxcb1-dev libxml2-dev lzma-dev meson nasm pkg-config python3-dev python3-pip texinfo wget yasm zlib1g-dev libdrm-dev
cd /home/pi/
mkdir ~/ffmpeg-libraries
git clone --depth 1 https://github.com/mstorsjo/fdk-aac.git ~/ffmpeg-libraries/fdk-aac \
&& cd ~/ffmpeg-libraries/fdk-aac \
&& autoreconf -fiv \
&& ./configure \
&& make -j$(nproc) \
&& sudo make install
git clone --depth 1 https://code.videolan.org/videolan/dav1d.git ~/ffmpeg-libraries/dav1d \
&& mkdir ~/ffmpeg-libraries/dav1d/build \
&& cd ~/ffmpeg-libraries/dav1d/build \
&& meson .. \
&& ninja \
&& sudo ninja install
git clone --depth 1 https://github.com/ultravideo/kvazaar.git ~/ffmpeg-libraries/kvazaar \
&& cd ~/ffmpeg-libraries/kvazaar \
&& ./autogen.sh \
&& ./configure \
&& make -j$(nproc) \
&& sudo make install
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx ~/ffmpeg-libraries/libvpx \
&& cd ~/ffmpeg-libraries/libvpx \
&& ./configure --disable-examples --disable-tools --disable-unit_tests --disable-docs \
&& make -j$(nproc) \
&& sudo make install
git clone --depth 1 https://aomedia.googlesource.com/aom ~/ffmpeg-libraries/aom \
&& mkdir ~/ffmpeg-libraries/aom/aom_build \
&& cd ~/ffmpeg-libraries/aom/aom_build \
&& cmake -G "Unix Makefiles" AOM_SRC -DENABLE_NASM=on -DPYTHON_EXECUTABLE="$(which python3)" -DCMAKE_C_FLAGS="-mfpu=vfp -mfloat-abi=hard" .. \
&& sed -i 's/ENABLE_NEON:BOOL=ON/ENABLE_NEON:BOOL=OFF/' CMakeCache.txt \
&& make -j$(nproc) \
&& sudo make install
git clone https://github.com/sekrit-twc/zimg.git ~/ffmpeg-libraries/zimg \
&& cd ~/ffmpeg-libraries/zimg \
&& sh autogen.sh \
&& ./configure \
&& make \
&& sudo make install
sudo ldconfig
wget -P ~/ffmpeg-libraries/ https://github.com/FFmpeg/FFmpeg/archive/n4.3.tar.gz
tar -xf ~/ffmpeg-libraries/n4.3.tar.gz -C ~/ffmpeg-libraries/
mv ~/ffmpeg-libraries/FFmpeg-n4.3/ ~/ffmpeg-libraries/FFmpeg/
sudo rm /home/pi/ffmpeg-libraries/n4.3.tar.gz
cd ~/ffmpeg-libraries/FFmpeg \
&& ./configure \
--extra-cflags="-I/usr/local/include" \
--extra-ldflags="-L/usr/local/lib" \
--extra-libs="-lpthread -lm" \
--arch=armel \
--enable-gmp \
--enable-gpl \
--enable-libaom \
--enable-libass \
--enable-libdav1d \
--enable-libdrm \
--enable-libfdk-aac \
--enable-libfreetype \
--enable-libkvazaar \
--enable-libmp3lame \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
--enable-libopus \
--enable-librtmp \
--enable-libsnappy \
--enable-libsoxr \
--enable-libssh \
--enable-libvorbis \
--enable-libvpx \
--enable-libzimg \
--enable-libwebp \
--enable-libx264 \
--enable-libx265 \
--enable-libxml2 \
--enable-mmal \
--enable-nonfree \
--enable-omx \
--enable-omx-rpi \
--enable-version3 \
--target-os=linux \
--enable-pthreads \
--enable-openssl \
--enable-hardcoded-tables \
&& make -j$(nproc) \
&& sudo make install
echo ""
echo "Installing OBS.........."
echo ""
sudo apt-get update
sudo apt-get -y 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
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
sudo git clone --recursive https://github.com/shivasiddharth/obs-studio.git
cd obs-studio
sudo mkdir build && cd build
sudo cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr ..
sudo make -j4
sudo make install
echo ""
echo "All done.........."
exit 0
@ShanuDey
Copy link

It is not working

@shivasiddharth
Copy link
Author

It is not working

What is the issue that you are running into ?

@Iamtotallyunsure
Copy link

Here is the error I keep getting.

In file included from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/graphics-ffmpeg.c:4:
/usr/local/include/libavformat/avformat.h:880:21: note: declared here
AVCodecContext *codec;
^~~~~
[ 1%] Building C object libobs/CMakeFiles/libobs.dir/graphics/quat.c.o
In file included from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/mmx.h:30,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/sse.h:33,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/sse2.h:35,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/sse-intrin.h:22,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/vec4.h:22,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/vec3.h:21,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/quat.h:22,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/quat.c:18:
/home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/simde-common.h:643:10: fatal error: simde-math.h: No such file or directory
#include "simde-math.h"
^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [libobs/CMakeFiles/libobs.dir/build.make:128: libobs/CMakeFiles/libobs.dir/graphics/quat.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:624: libobs/CMakeFiles/libobs.dir/all] Error 2
[ 2%] Linking C shared library libobsglad.so
[ 2%] Built target glad
[ 2%] Built target obspython_swig_compilation
make: *** [Makefile:152: all] Error 2
[ 1%] Built target glad
[ 1%] Building C object deps/media-playback/CMakeFiles/media-playback.dir/media-playback/decode.c.o
In file included from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/mmx.h:30,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/sse.h:33,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/sse2.h:35,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/sse-intrin.h:22,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/vec4.h:22,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/vec3.h:21,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/obs.h:26,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/deps/media-playback/media-playback/media.h:19,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/deps/media-playback/media-playback/decode.c:18:
/home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/simde-common.h:643:10: fatal error: simde-math.h: No such file or directory
#include "simde-math.h"
^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [deps/media-playback/CMakeFiles/media-playback.dir/build.make:63: deps/media-playback/CMakeFiles/media-playback.dir/media-playback/decode.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:215: deps/media-playback/CMakeFiles/media-playback.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

All done..........

@shivasiddharth
Copy link
Author

Here is the error I keep getting.

In file included from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/graphics-ffmpeg.c:4:
/usr/local/include/libavformat/avformat.h:880:21: note: declared here
AVCodecContext *codec;
^~~~~
[ 1%] Building C object libobs/CMakeFiles/libobs.dir/graphics/quat.c.o
In file included from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/mmx.h:30,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/sse.h:33,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/sse2.h:35,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/sse-intrin.h:22,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/vec4.h:22,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/vec3.h:21,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/quat.h:22,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/quat.c:18:
/home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/simde-common.h:643:10: fatal error: simde-math.h: No such file or directory
#include "simde-math.h"
^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [libobs/CMakeFiles/libobs.dir/build.make:128: libobs/CMakeFiles/libobs.dir/graphics/quat.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:624: libobs/CMakeFiles/libobs.dir/all] Error 2
[ 2%] Linking C shared library libobsglad.so
[ 2%] Built target glad
[ 2%] Built target obspython_swig_compilation
make: *** [Makefile:152: all] Error 2
[ 1%] Built target glad
[ 1%] Building C object deps/media-playback/CMakeFiles/media-playback.dir/media-playback/decode.c.o
In file included from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/mmx.h:30,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/sse.h:33,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/sse2.h:35,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/sse-intrin.h:22,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/vec4.h:22,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/vec3.h:21,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/obs.h:26,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/deps/media-playback/media-playback/media.h:19,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/deps/media-playback/media-playback/decode.c:18:
/home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/simde-common.h:643:10: fatal error: simde-math.h: No such file or directory
#include "simde-math.h"
^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [deps/media-playback/CMakeFiles/media-playback.dir/build.make:63: deps/media-playback/CMakeFiles/media-playback.dir/media-playback/decode.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:215: deps/media-playback/CMakeFiles/media-playback.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

All done..........

Which version of the Raspbian are you using ?

@kR0N0S973
Copy link

i have the same problem with the new raspbian based on debian 10 (buster), i will give it a try with ubuntu, maybe it works, if not probably downgrade? i read something that the math.h library isnt in buster idk or do you have some workaround? thanks

@Iamtotallyunsure
Copy link

Iamtotallyunsure commented Jun 25, 2020

pi@raspberrypi:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

I meant it installed great the first time then I had to restart my pi from scratch and reinstalled the OS then I tried to reinstall and nothing. Thank you for all your help. As I am a complete noob.

@shivasiddharth
Copy link
Author

Just for clarification, is that Raspberry Pi OS or Raspbian from Feb release ?

@Iamtotallyunsure
Copy link

Iamtotallyunsure commented Jun 25, 2020

Unsure I just wrote the image from the raspberry pi website 2 or 3 days ago https://www.raspberrypi.org/downloads/
Raspberry Pi OS (previously called Raspbian)
The official supported Raspberry Pi Operating System - based on Debian Buster

@kR0N0S973
Copy link

can you share your compiled obs? or is it useless, i am not so good with linux and hardware compiled software

@Iamtotallyunsure
Copy link

Iamtotallyunsure commented Jun 25, 2020

how do I do that? Whats is above is as far as I got.

@jameyj
Copy link

jameyj commented Jun 26, 2020

I'm getting the exact same "simde-math.h" errors. I also get this error using the code directly from the OBS forum. Went back to 02-20 Buster and the same.

@keeshux
Copy link

keeshux commented Jun 27, 2020

The issue is that simde is a clunky copy-paste in obs-studio.

The quick & dirty fix is:

@Iamtotallyunsure
Copy link

Thank you for your help. how to you do that. I am a noob. I understand the concept of what you are sayin,g but am unsure the process to get it accomplished.

@Roscobird
Copy link

Roscobird commented Jun 29, 2020

Hello, I am getting the same error also. From above comment, When you say "Clone https://github.com/simd-everywhere/simde
Move these from simde/x86 to simde:
mmx.h
sse.h
sse2.h
Delete libobs/util/simde from obs-studio
Copy the simde directory to libobs/util/simde"
I understand to clone the address but Where do we look atto move the files from simde/x to simde. Which file folder and directory are they in? Sorry I am a noob to Raspian also. Here is my the last part of the error log that I ran into. And I really appreciate helping us out to get OBS on it :) Thanks Again

Also to note, I just download a fresh install of raspian and then installed Astroberry over it.

/home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/simde-common.h:643:10: fatal error: simde-math.h: No such file or directory
#include "simde-math.h"
^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [deps/media-playback/CMakeFiles/media-playback.dir/build.make:63: deps/media-playback/CMakeFiles/media-playback.dir/media-playback/decode.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:215: deps/media-playback/CMakeFiles/media-playback.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 0%] Building C object deps/glad/CMakeFiles/glad.dir/src/glad_glx.c.o
[ 0%] Building C object libobs/CMakeFiles/libobs.dir/callback/calldata.c.o
[ 0%] Building C object libobs/CMakeFiles/libobs.dir/callback/decl.c.o
[ 0%] Building C object libobs/CMakeFiles/libobs.dir/callback/signal.c.o
[ 1%] Building C object libobs/CMakeFiles/libobs.dir/callback/proc.c.o
[ 1%] Building C object libobs/CMakeFiles/libobs.dir/graphics/graphics-ffmpeg.c.o
/home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/graphics-ffmpeg.c: In function ‘ffmpeg_image_open_decoder_context’:
/home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/graphics-ffmpeg.c:34:2: warning: ‘codec’ is deprecated [-Wdeprecated-declarations]
info->decoder_ctx = info->stream->codec;
^~~~
In file included from /home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/graphics-ffmpeg.c:4:
/usr/include/arm-linux-gnueabihf/libavformat/avformat.h:878:21: note: declared here
AVCodecContext *codec;
^~~~~
[ 1%] Building C object libobs/CMakeFiles/libobs.dir/graphics/quat.c.o
In file included from /home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/mmx.h:30,
from /home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/sse.h:33,
from /home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/sse2.h:35,
from /home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/sse-intrin.h:22,
from /home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/vec4.h:22,
from /home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/vec3.h:21,
from /home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/quat.h:22,
from /home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/quat.c:18:
/home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/simde-common.h:643:10: fatal error: simde-math.h: No such file or directory
#include "simde-math.h"
^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [libobs/CMakeFiles/libobs.dir/build.make:128: libobs/CMakeFiles/libobs.dir/graphics/quat.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:624: libobs/CMakeFiles/libobs.dir/all] Error 2
[ 2%] Linking C shared library libobsglad.so
[ 2%] Built target glad
[ 2%] Built target obspython_swig_compilation
make: *** [Makefile:152: all] Error 2
[ 1%] Built target glad
[ 1%] Building C object deps/media-playback/CMakeFiles/media-playback.dir/media-playback/decode.c.o
In file included from /home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/mmx.h:30,
from /home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/sse.h:33,
from /home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/sse2.h:35,
from /home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/sse-intrin.h:22,
from /home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/vec4.h:22,
from /home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/vec3.h:21,
from /home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/obs.h:26,
from /home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/deps/media-playback/media-playback/media.h:19,
from /home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/deps/media-playback/media-playback/decode.c:18:
/home/astroberry/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/simde-common.h:643:10: fatal error: simde-math.h: No such file or directory
#include "simde-math.h"
^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [deps/media-playback/CMakeFiles/media-playback.dir/build.make:63: deps/media-playback/CMakeFiles/media-playback.dir/media-playback/decode.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:215: deps/media-playback/CMakeFiles/media-playback.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

All done..........
astroberry@astroberry:~ $

@Iamtotallyunsure
Copy link

My latest error
[ 0%] Building C object deps/glad/CMakeFiles/glad.dir/src/glad.c.o
[ 0%] Swig compile obspython.i for python
[ 0%] Building C object deps/media-playback/CMakeFiles/media-playback.dir/media-playback/decode.c.o
In file included from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/mmx.h:30,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/sse.h:33,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/sse2.h:35,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/sse-intrin.h:22,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/vec4.h:22,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/vec3.h:21,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/obs.h:26,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/deps/media-playback/media-playback/media.h:19,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/deps/media-playback/media-playback/decode.c:18:
/home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/simde-common.h:643:10: fatal error: simde-math.h: No such file or directory
#include "simde-math.h"
^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [deps/media-playback/CMakeFiles/media-playback.dir/build.make:63: deps/media-playback/CMakeFiles/media-playback.dir/media-playback/decode.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:215: deps/media-playback/CMakeFiles/media-playback.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 0%] Building C object deps/glad/CMakeFiles/glad.dir/src/glad_glx.c.o
[ 0%] Building C object libobs/CMakeFiles/libobs.dir/callback/calldata.c.o
[ 0%] Building C object libobs/CMakeFiles/libobs.dir/callback/decl.c.o
[ 0%] Building C object libobs/CMakeFiles/libobs.dir/callback/signal.c.o
[ 1%] Building C object libobs/CMakeFiles/libobs.dir/callback/proc.c.o
[ 1%] Building C object libobs/CMakeFiles/libobs.dir/graphics/graphics-ffmpeg.c.o
/home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/graphics-ffmpeg.c: In function ‘ffmpeg_image_open_decoder_context’:
/home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/graphics-ffmpeg.c:34:2: warning: ‘codec’ is deprecated [-Wdeprecated-declarations]
info->decoder_ctx = info->stream->codec;
^~~~
In file included from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/graphics-ffmpeg.c:4:
/usr/include/arm-linux-gnueabihf/libavformat/avformat.h:878:21: note: declared here
AVCodecContext *codec;
^~~~~
[ 1%] Building C object libobs/CMakeFiles/libobs.dir/graphics/quat.c.o
In file included from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/mmx.h:30,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/sse.h:33,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/sse2.h:35,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/sse-intrin.h:22,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/vec4.h:22,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/vec3.h:21,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/quat.h:22,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/quat.c:18:
/home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/simde-common.h:643:10: fatal error: simde-math.h: No such file or directory
#include "simde-math.h"
^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [libobs/CMakeFiles/libobs.dir/build.make:128: libobs/CMakeFiles/libobs.dir/graphics/quat.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:624: libobs/CMakeFiles/libobs.dir/all] Error 2
[ 2%] Linking C shared library libobsglad.so
[ 2%] Built target glad
[ 2%] Built target obspython_swig_compilation
make: *** [Makefile:152: all] Error 2
[ 1%] Built target glad
[ 1%] Building C object deps/media-playback/CMakeFiles/media-playback.dir/media-playback/decode.c.o
In file included from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/mmx.h:30,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/sse.h:33,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/sse2.h:35,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/sse-intrin.h:22,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/vec4.h:22,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/vec3.h:21,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/obs.h:26,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/deps/media-playback/media-playback/media.h:19,
from /home/pi/ffmpeg-libraries/FFmpeg/obs-studio/deps/media-playback/media-playback/decode.c:18:
/home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/simde-common.h:643:10: fatal error: simde-math.h: No such file or directory
#include "simde-math.h"
^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [deps/media-playback/CMakeFiles/media-playback.dir/build.make:63: deps/media-playback/CMakeFiles/media-playback.dir/media-playback/decode.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:215: deps/media-playback/CMakeFiles/media-playback.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

@jameyj
Copy link

jameyj commented Jun 30, 2020

I was able to install OBS by cloning simde from GitHub and then copying simde-math.h from /pi/simde and pasting it into /pi/obs-studio/libobs/util/simde. You can do this right before running sudo make -j4. Now if I could only get OBS to recognize my Auvidea B101 on CS-2 with the Toshiba drivers...

@kR0N0S973
Copy link

Works fine how jameyj said, i only added that file to the lib folder of obs before creating the build folder etc... and than it compiled perfectly, got like pushing the arm to 2000mhz on the pi4 an output of: 420x2XX at 24fps, with a gif as background and a radio sender played with the vlc. Screen recording is like: 7fps xd, vlc streaming with video is the same, laggy

@Iamtotallyunsure
Copy link

all i get is a copy of a webpage

@Iamtotallyunsure
Copy link

I am still clueless how you guy did anything that you are talking about.

@kR0N0S973
Copy link

just edit the script, commenting all from "cd obs-studio" with #, execute the script, You should now have the obs-studio folder.

Now clone the simde github with: "git clone https://github.com/simd-everywhere/simde", now you have a simde folder next to the obs folder, open it and copy simde-math.h file and put it inside "obs-studio/libobs/util/simde", now just go inside the obs-folder, and execute the last 5 commands manually:

cd obs-studio
sudo mkdir build && cd build
sudo cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr ..
sudo make -j4
sudo make install

Now after it you should have installed it fine.

Idk i did before installing obs the pi firmware upgrade, but should not be needed.

@Iamtotallyunsure
Copy link

/home/pi/ffmpeg-libraries/FFmpeg/obs-studio/libobs/graphics/../util/simde/simde-common.h:643:10: fatal error: simde-math.h: No such file or directory
#include "simde-math.h"
^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [libobs/CMakeFiles/libobs.dir/build.make:128: libobs/CMakeFiles/libobs.dir/graphics/quat.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 4%] Linking C shared library libobsglad.so
[ 4%] Built target glad
make[1]: *** [CMakeFiles/Makefile2:624: libobs/CMakeFiles/libobs.dir/all] Error 2
[ 4%] Built target obspython_swig_compilation
make: *** [Makefile:152: all] Error 2

@Iamtotallyunsure
Copy link

Yeah I think I got it with your all's help. I put it in the wrong folder.

@Iamtotallyunsure
Copy link

Thank you again for all your help.

any good with camera troubleshooting?
https://www.raspberrypi.org/forums/viewtopic.php?f=38&t=278757

@shivasiddharth
Copy link
Author

shivasiddharth commented Jul 1, 2020

I forked the OBS repo and added the math file by myself. I have now pointed the installation to my repo. So from now on changes need not be done manually. Sorry for responding late, was tied up with personal commitments.

@jhamilt0n
Copy link

jhamilt0n commented Jul 22, 2020

I am getting the following error:
mkdir: cannot create directory ‘build’: File exists
CMake Error: The source directory "/home/pi/ffmpeg-libraries/FFmpeg" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target 'install'. Stop.

All done..........

Any ideas on how to resolve this?

Update: Attempted again and am now getting:
CMake Error at CMakeLists.txt:62 (include):
include could not find load file:

ObsHelpers

CMake Error at CMakeLists.txt:63 (include):
include could not find load file:

ObsCpack

-- No Native SSE2 SIMD Support - Using SIMDE
CMake Error at CMakeLists.txt:236 (add_subdirectory):
add_subdirectory given source "deps" which is not an existing directory.

CMake Error at CMakeLists.txt:243 (add_subdirectory):
add_subdirectory given source "libobs-opengl" which is not an existing
directory.

CMake Error at CMakeLists.txt:244 (add_subdirectory):
add_subdirectory given source "libobs" which is not an existing directory.

CMake Error at CMakeLists.txt:245 (add_subdirectory):
add_subdirectory given source "plugins" which is not an existing directory.

CMake Error at CMakeLists.txt:246 (add_subdirectory):
add_subdirectory given source "UI" which is not an existing directory.

CMake Error at CMakeLists.txt:256 (add_subdirectory):
add_subdirectory given source "cmake/helper_subdir" which is not an
existing directory.

CMake Error at CMakeLists.txt:261 (include):
include could not find load file:

CopyMSVCBins

-- Configuring incomplete, errors occurred!
See also "/home/pi/ffmpeg-libraries/FFmpeg/obs-studio/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target 'install'. Stop.

All done..........

@rdmueller
Copy link

rdmueller commented Sep 4, 2020

thanx for creating this script.
unfortunately, I run into problems. The funny thing is, every time I run sudo make -j4 it gets a bit further but it will not succeed.

last error message I get is

make[2]: *** [plugins/obs-ffmpeg/ffmpeg-mux/CMakeFiles/obs-ffmpeg-mux.dir/build.make:87: plugins/obs-ffmpeg/ffmpeg-mux/obs-ffmpeg-mux] Error 1
make[1]: *** [CMakeFiles/Makefile2:1526: plugins/obs-ffmpeg/ffmpeg-mux/CMakeFiles/obs-ffmpeg-mux.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

but I guess I have to start with the first error to analyze...

update:

Here are the last few lines of a fresh run:

/usr/bin/ld: /home/pi/ffmpeg-libraries/FFmpeg/libavformat/srtp.c:318: undefined reference to `av_hmac_update'
collect2: error: ld returned 1 exit status
make[2]: *** [plugins/obs-ffmpeg/ffmpeg-mux/CMakeFiles/obs-ffmpeg-mux.dir/build.make:87: plugins/obs-ffmpeg/ffmpeg-mux/obs-ffmpeg-mux] Error 1
make[1]: *** [CMakeFiles/Makefile2:1446: plugins/obs-ffmpeg/ffmpeg-mux/CMakeFiles/obs-ffmpeg-mux.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

All done..........

It seems that it already fails to build the ffmpeg libraries...

Any idea what could be the problem?

Raspberry Pi 4 with 4GB and latest raspberrian full install

@jhamilt0n
Copy link

sudo cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr ..
CMake Error: The source directory "/home/pi" does not appear to contain CMakeLists.txt.

I'm getting this error when trying to install. Any ideas on how to correct this?

@pseudofunizer
Copy link

pseudofunizer commented Apr 14, 2021

sudo cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr ..
CMake Error: The source directory "/home/pi" does not appear to contain CMakeLists.txt.

I'm getting this error when trying to install. Any ideas on how to correct this?

You are in the wrong directory and are attempting to build so that CMake is referring to a non-existent file.

You can try instead i.e. (copy and paste the following highlighted text into the terminal if you know what you are doing ...):

cd $HOME && mkdir obs-tmp && cd obs-tmp && git clone --recursive https://github.com/obsproject/obs-studio.git && cd obs-studio && mkdir build && cd build && cmake -DBUILD_BROWSER=OFF -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr ..

Note that the -DBUILD_BROWSER=OFF flag will not build the browser source; also, good luck in getting the /opt/vc/lib/libEGL.so / libobsglad.so linking to work, that's where I'm stuck on the RPi4B at the moment myself. :P

@lweingart
Copy link

Hi, thank you for the script.
I was able to make it run smoothly, but when I try to run OBS I get a pop up with the following message:
"Error: Failed to initialize video. You GPU may not be supported, or your graphic drivers may need to be updated"

I have a brand new Raspberry 4 and installed the latest Raspberry OS:

$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Would you have an idea what I could do next ?

Thank you for your esteemed help

@lweingart
Copy link

Hi again,

It appears that the solution is launching obs this way:
LIBGL_ALWAYS_SOFTWARE=1 obs

It did the trick at least for me.

Cheers everyone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment