From RidgeRun Developer Wiki
#!/bin/bash
cd $HOME/
if [ $# -eq 0 ]; then
echo "***No argument supplied***"
echo "Usage:"
echo "./jetson-build-gstreamer.sh <VERSION>"
echo "Example:"
echo "./jetson-build-gstreamer.sh 1.16.0"
exit
fi
#Install dependencies
sudo apt-get -y install build-essential dpkg-dev flex bison autotools-dev automake \
autopoint libtool gtk-doc-tools libgstreamer1.0-dev \
libxv-dev libasound2-dev libtheora-dev libogg-dev libvorbis-dev \
libbz2-dev libv4l-dev libvpx-dev libjack-jackd2-dev libsoup2.4-dev libpulse-dev \
faad libfaad-dev libgl1-mesa-dev libgles2-mesa-dev \
libx264-dev libmad0-dev liborc-0.4-dev liborc-0.4-0 liborc-0.4-0-dbg liborc-0.4-doc
#The version you want to install is given as a command-line argument
VERSION=$1
echo "Starting GStreamer Installation..."
#Set an absolute path for building directory
mkdir $HOME/gst_$VERSION
cd $HOME/gst_$VERSION
#Get the sources of the basic stuff (core, base, good, bad, ugly)
wget https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-$VERSION.tar.xz --no-check-certificate
wget https://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-$VERSION.tar.xz --no-check-certificate
wget https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-$VERSION.tar.xz --no-check-certificate
wget https://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-$VERSION.tar.xz --no-check-certificate
wget https://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-$VERSION.tar.xz --no-check-certificate
#Untar all
for a in `ls -1 *.tar.*`; do tar -xf $a; done
export PKG_CONFIG_PATH=$HOME/gst_$VERSION/out/lib/pkgconfig
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/aarch64-linux-gnu/pkgconfig
export LD_LIBRARY_PATH=$HOME/gst_$VERSION/out/lib
mkdir -p $HOME/gst_$VERSION/out
#Gstreamer Core
cd gstreamer-$VERSION
./configure --prefix=$HOME/gst_$VERSION/out;
make;
make install;
cd ..
#Gstreamer Base
cd gst-plugins-base-$VERSION
./configure --prefix=$HOME/gst_$VERSION/out;
make;
make install;
cd ..
#Gstreamer Good
cd gst-plugins-good-$VERSION
./configure --prefix=$HOME/gst_$VERSION/out;
make;
make install;
cd ..
#Gstreamer Bad
cd gst-plugins-bad-$VERSION
./configure --prefix=$HOME/gst_$VERSION/out;
make;
make install;
cd ..
#Gstreamer Ugly
cd gst-plugins-ugly-$VERSION
./configure --prefix=$HOME/gst_$VERSION/out;
make;
make install;
cd ..
export LD_LIBRARY_PATH=$HOME/gst_$VERSION/out/lib
#Copy NVIDIA GStreamer libraries
cd /usr/lib/aarch64-linux-gnu/gstreamer-1.0/
cp libgstnv* libgstomx.so $HOME/gst_$VERSION/out/lib/gstreamer-1.0/
gst-inspect-1.0 --version
cd $HOME/