Last active
February 14, 2020 23:03
-
-
Save steveseguin/867503d555278dc5685571865c1a9686 to your computer and use it in GitHub Desktop.
GStreamer and FFmpeg for Raspberry Pi ; master builds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash --debugger | |
set -e | |
if grep -q BCM2708 /proc/cpuinfo; then | |
echo "RPI BUILD!" | |
RPI="1" | |
fi | |
grep -q BCM2 /proc/cpuinfo && sudo apt-get update && sudo apt-get upgrade -y | |
#echo "deb http://www.deb-multimedia.org buster main non-free" >> /etc/apt/sources.list | |
#apt-get update -oAcquire::AllowInsecureRepositories=true | |
#sudo apt-get install deb-multimedia-keyring -y | |
#sudo dpkg --remove libnice-dev libsrtp2-dev libusrsctp-dev | |
sudo apt autoremove -y | |
sudo apt-get install libomxil-bellagio-dev libfreetype6-dev libmp3lame-dev checkinstall libx264-dev fonts-freefont-ttf libasound2-dev -y | |
# Create a log file of the build as well as displaying the build on the tty as it runs | |
exec > >(tee build_gstreamer.log) | |
exec 2>&1 | |
# Update and Upgrade the Pi, otherwise the build may fail due to inconsistencies | |
grep -q BCM2708 /proc/cpuinfo && sudo apt-get update && sudo apt-get upgrade -y --force-yes | |
# Get the required libraries | |
sudo apt-get install -y --force-yes build-essential autotools-dev automake autoconf \ | |
libtool autopoint libxml2-dev zlib1g-dev libglib2.0-dev \ | |
pkg-config bison flex python3 git gtk-doc-tools libasound2-dev \ | |
libgudev-1.0-dev libxt-dev libvorbis-dev libcdparanoia-dev \ | |
libpango1.0-dev libtheora-dev libvisual-0.4-dev iso-codes \ | |
libgtk-3-dev libraw1394-dev libiec61883-dev libavc1394-dev \ | |
libv4l-dev libcairo2-dev libcaca-dev libspeex-dev libpng-dev \ | |
libshout3-dev libjpeg-dev libaa1-dev libflac-dev libdv4-dev \ | |
libtag1-dev libwavpack-dev libpulse-dev libsoup2.4-dev libbz2-dev \ | |
libcdaudio-dev libdc1394-22-dev ladspa-sdk libass-dev \ | |
libcurl4-gnutls-dev libdca-dev libdirac-dev libdvdnav-dev \ | |
libexempi-dev libexif-dev libfaad-dev libgme-dev libgsm1-dev \ | |
libiptcdata0-dev libkate-dev libmimic-dev libmms-dev \ | |
libmodplug-dev libmpcdec-dev libofa0-dev libopus-dev \ | |
librsvg2-dev librtmp-dev libschroedinger-dev libslv2-dev \ | |
libsndfile1-dev libsoundtouch-dev libspandsp-dev libx11-dev \ | |
libxvidcore-dev libzbar-dev libzvbi-dev liba52-0.7.4-dev \ | |
libcdio-dev libdvdread-dev libmad0-dev libmp3lame-dev \ | |
libmpeg2-4-dev libopencore-amrnb-dev libopencore-amrwb-dev \ | |
libsidplay1-dev libtwolame-dev libx264-dev libusb-1.0 \ | |
python-gi-dev yasm python3-dev libgirepository1.0-dev | |
sudo apt-get install -y build-essential autotools-dev automake autoconf checkinstall \ | |
libtool autopoint libxml2-dev zlib1g-dev libglib2.0-dev \ | |
pkg-config bison flex python3 wget tar gtk-doc-tools libasound2-dev \ | |
libgudev-1.0-dev libvorbis-dev libcdparanoia-dev \ | |
libtheora-dev libvisual-0.4-dev iso-codes \ | |
libraw1394-dev libiec61883-dev libavc1394-dev \ | |
libv4l-dev libcaca-dev libspeex-dev libpng-dev \ | |
libshout3-dev libjpeg-dev libflac-dev libdv4-dev \ | |
libtag1-dev libwavpack-dev libsoup2.4-dev libbz2-dev \ | |
libcdaudio-dev libdc1394-22-dev ladspa-sdk libass-dev \ | |
libcurl4-gnutls-dev libdca-dev libdvdnav-dev \ | |
libexempi-dev libexif-dev libfaad-dev libgme-dev libgsm1-dev \ | |
libiptcdata0-dev libkate-dev libmimic-dev libmms-dev \ | |
libmodplug-dev libmpcdec-dev libofa0-dev libopus-dev \ | |
librtmp-dev libsndfile1-dev libsoundtouch-dev libspandsp-dev \ | |
libxvidcore-dev libvpx-dev libzvbi-dev liba52-0.7.4-dev \ | |
libcdio-dev libdvdread-dev libmad0-dev libmp3lame-dev \ | |
libmpeg2-4-dev libopencore-amrnb-dev libopencore-amrwb-dev \ | |
libsidplay1-dev libtwolame-dev libx264-dev libusb-1.0 \ | |
python-gi-dev yasm python3-dev libgirepository1.0-dev \ | |
freeglut3 weston wayland-protocols pulseaudio libpulse-dev libssl-dev -y | |
sudo apt-get install autotools-dev gnome-pkg-tools libtool libffi-dev libelf-dev \ | |
libpcre3-dev desktop-file-utils libselinux1-dev libgamin-dev dbus \ | |
dbus-x11 shared-mime-info libxml2-utils \ | |
libssl-dev libreadline-dev libsqlite3-dev -y | |
sudo apt-get install language-pack-en ccache git curl bison flex yasm python3-pip \ | |
libasound2-dev libbz2-dev libcap-dev libdrm-dev libegl1-mesa-dev \ | |
libfaad-dev libgl1-mesa-dev libgles2-mesa-dev libgmp-dev libgsl0-dev \ | |
libjpeg-dev libmms-dev libmpg123-dev libogg-dev libopus-dev \ | |
liborc-0.4-dev libpango1.0-dev libpng-dev libpulse-dev librtmp-dev \ | |
libtheora-dev libtwolame-dev libvorbis-dev libvpx-dev libwebp-dev \ | |
pkg-config unzip zlib1g-dev -y | |
cd ~ | |
git clone https://github.com/GNOME/glib.git | |
cd glib | |
[e ! -d build ] && mkdir build | |
meson build | |
sudo ninja -C build install | |
cd ~ | |
git clone https://github.com/libnice/libnice.git \ | |
&& cd libnice \ | |
&& ./autogen.sh --prefix=/usr --with-gstreamer --enable-static --enable-static-plugins --enable-shared --without-gstreamer-0.10 --disable-gtk-doc --enable-compile-warnings=no \ | |
&& make install | |
sudo apt-get remove libsrtp-dev -y | |
cd ~ | |
git clone https://github.com/cisco/libsrtp/ | |
cd libsrtp | |
./configure --prefix=/usr --enable-openssl | |
make | |
sudo make install | |
cd ~ | |
git clone git://anongit.freedesktop.org/pulseaudio/webrtc-audio-processing | |
cd webrtc-audio-processing | |
[e ! -d build ] && mkdir build | |
meson build | |
sudo ninja -C build install | |
sudo apt-get remove libsctp-dev -y | |
cd ~ | |
git clone https://github.com/sctplab/usrsctp | |
cd usrsctp | |
./bootstrap | |
./configure --prefix=/usr | |
make | |
sudo make install | |
cd ~ | |
git clone https://github.com/FFmpeg/FFmpeg.git | |
cd FFmpeg | |
sudo ./configure --enable-shared --disable-programs --enable-pic --disable-doc--arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree --enable-libfreetype --enable-libx264 --enable-libmp3lame --enable-mmal --enable-indev=alsa --enable-outdev=alsa | |
make | |
sudo make install | |
# get the repos if they're not already there | |
cd $HOME | |
[ ! -d src ] && mkdir src | |
cd src | |
[ ! -d gstreamer ] && mkdir gstreamer | |
cd gstreamer | |
# get repos if they are not there yet | |
[ ! -d gstreamer ] && git clone git://anongit.freedesktop.org/git/gstreamer/gstreamer | |
[ ! -d gst-plugins-base ] && git clone git://anongit.freedesktop.org/git/gstreamer/gst-plugins-base | |
[ ! -d gst-plugins-good ] && git clone git://anongit.freedesktop.org/git/gstreamer/gst-plugins-good | |
[ ! -d gst-plugins-bad ] && git clone git://anongit.freedesktop.org/git/gstreamer/gst-plugins-bad | |
[ ! -d gst-plugins-ugly ] && git clone git://anongit.freedesktop.org/git/gstreamer/gst-plugins-ugly | |
[ ! -d gst-libav ] && git clone git://anongit.freedesktop.org/git/gstreamer/gst-libav | |
[ ! -d gst-omx ] && git clone git://anongit.freedesktop.org/git/gstreamer/gst-omx | |
[ ! -d gst-python ] && git clone git://anongit.freedesktop.org/git/gstreamer/gst-python | |
[ ! $RPI ] && [ ! -d gstreamer-vaapi ] && git clone git://anongit.freedesktop.org/git/gstreamer/gstreamer-vaapi | |
export LD_LIBRARY_PATH=/usr/local/lib/ | |
# checkout branch (default=master) and build & install | |
cd gstreamer | |
git pull | |
[ ! -d build ] && mkdir build | |
cd build | |
/home/pi/.local/bin/meson --prefix=/usr -Dbuildtype=release -Dgst_debug=false -Dgtk_doc=disabled | |
cd .. | |
sudo ninja -C build install | |
cd .. | |
cd gst-plugins-base | |
git pull | |
[ ! -d build ] && mkdir build | |
cd build | |
/home/pi/.local/bin/meson --prefix=/usr -Dbuildtype=release -Dgst_debug=false -Dgtk_doc=disabled | |
cd .. | |
sudo ninja -C build install | |
cd .. | |
cd gst-plugins-good | |
git pull | |
[ ! -d build ] && mkdir build | |
cd build | |
/home/pi/.local/bin/meson --prefix=/usr -Dbuildtype=release -Dgst_debug=false -Dgtk_doc=disabled | |
cd .. | |
sudo ninja -C build install | |
cd .. | |
cd gst-plugins-ugly | |
git pull | |
[ ! -d build ] && mkdir build | |
cd build | |
/home/pi/.local/bin/meson --prefix=/usr -Dbuildtype=release -Dgst_debug=false -Dgtk_doc=disabled | |
cd .. | |
sudo ninja -C build install | |
cd .. | |
cd gst-libav | |
git pull | |
[ ! -d build ] && mkdir build | |
cd build | |
/home/pi/.local/bin/meson --prefix=/usr -Dbuildtype=release -Dgst_debug=false -Dgtk_doc=disabled -Dwith-omx-header-path=/opt/vc/include/IL --reconfigure | |
cd .. | |
sudo ninja -C build install | |
cd .. | |
cd gst-plugins-bad | |
git pull | |
[e ! -d build ] && mkdir build | |
/home/pi/.local/bin/meson build --prefix=/usr -Dbuildtype=release -Dgst_debug=false -Dgtk_doc=disabled -Dexamples=disabled -Dx11=disabled -Dglx=disabled -Dopengl=disabled -D target=rpi -D header_path=/opt/vc/include/IL/ --reconfigure | |
sudo ninja -C build install | |
cd .. | |
# python bindings | |
cd gst-python | |
git pull | |
[ ! -d build ] && mkdir build | |
cd build | |
/home/pi/.local/bin/meson --prefix=/usr -Dbuildtype=release -Dgst_debug=false -Dgtk_doc=disabled | |
cd .. | |
sudo ninja -C build install | |
cd .. | |
# omx support | |
cd gst-omx | |
git pull | |
[ ! -d build ] && mkdir build | |
#export LDFLAGS='-L/opt/vc/lib' \ | |
#CFLAGS='-I/opt/vc/include -I/opt/vc/include/IL -I/opt/vc/include/interface/vcosse/pthreads -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/IL' \ | |
#CPPFLAGS='-I/opt/vc/include -I/opt/vc/include/IL -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/IL' | |
/home/pi/.local/bin/meson build -D target=rpi -D header_path=/opt/vc/include/IL/ --reconfigure | |
#make CFLAGS+="-Wno-error -Wno-redundant-decls" LDFLAGS+="-L/opt/vc/lib" | |
sudo ninja -C build install | |
cd .. | |
sudo ldconfig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment