Open Source Media Framework - GStreamer VAAPI/Intel® Media SDK Installation Environment

ID 751777
Updated 3/11/2022
Version Latest
Public

author-image

By

To install basic dependent packages

1. To install basic dependencies on Ubuntu* (18.04)

Basic:

#apt-get install -y cifs-utils autoconf libtool libdrm-dev yasm libghc-x11-dev libxmuu-dev libxfixes-dev libxcb-glx0-dev libgegl-dev libegl1-mesa-dev libcogl-gles2-dev

#apt-get install –y cifs-utils git xutils-dev libpciaccess-dev xserver-xorg-dev meson

#apt-get install –y libv4l-dev

#apt-get install –y libasound2-dev

Gstreamer and Gstreamer Plugins dependencies:

  • To install related pkg for gst core

#apt-get install -y bison flex gtk-doc-tools libpackagekit-glib2-dev autopoint libgudev-1.0-dev

  • To install related pkg for gst-base

#apt-get install -y liboggz2-dev libvorbis-dev libtheora-dev

  • To install related pkg for gst-good

#apt-get install -y liborc-0.4-dev libjpeg-dev

  • To install related pkg for gst-devtools

#apt-get install -y libjson-glib-dev

2. To install basic dependencies on CentOS (7.5)

Basic:

#yum group install -y "Development Tools"

#yum install -y git autoconf.noarch automake.noarch xorg-x11-server-devel epel-release cmake cmake3 libtool meson ninja-build

Upgrade automake version to 1.14+ (gstreamer build required)

#wget http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz

#tar zxvf automake-1.14.1.tar.gz

#cd automake-1.14.1

#./configure --prefix=/usr

#make

#make install

Gstreamer and Gstreamer Plugins dependencies:

  • To install related pkg for gst core

#yum install -y gtk-doc glib2-devel

  • To install related pkg for gst-base

#yum install -y libvorbis-devel libtheora-devel

  • To install related pkg for gst-good

#yum install -y libjpeg-turbo-devel orc-devel

  • To install related pkg for gst-bad (using for gst-msdk)

#yum install -y libgudev1-devel

  • To install related pkg for gst-devtools

#yum install -y json-glib-devel

To setup downloaded source code and to build and install environment

#export ROOT_INSTALL_DIR=/opt/media/

#mkdir -p $ROOT_INSTALL_DIR

#export SRC_DIR=$HOME/media_src/

#mkdir -p $SRC_DIR

For Ubuntu(18.04)

#export PKG_CONFIG_PATH=$ROOT_INSTALL_DIR/lib/pkgconfig/:$PKG_CONFIG_PATH
#export LD_LIBRARY_PATH=$ROOT_INSTALL_DIR/lib:$ROOT_INSTALL_DIR/lib/mfx/:$ROOT_INSTALL_DIR/lib/xorg/:$LD_LIBRARY_PATH
#export LDFLAGS="-L$ROOT_INSTALL_DIR/lib"

For CentOS (7.5)

#export PKG_CONFIG_PATH=$ROOT_INSTALL_DIR/lib/pkgconfig/:$ROOT_INSTALL_DIR/lib64/pkgconfig/:$PKG_CONFIG_PATH
#export LD_LIBRARY_PATH=$ROOT_INSTALL_DIR/lib:$ROOT_INSTALL_DIR/lib64:$LD_LIBRARY_PATH
#export LDFLAGS="-L$ROOT_INSTALL_DIR/lib -L$ROOT_INSTALL_DIR/lib64"

#export CPPFLAGS="-I$ROOT_INSTALL_DIR/include $CPPFLAGS"

#export CFLAGS="-I$ROOT_INSTALL_DIR/include $CFLAGS"

#export CXXFLAGS="-I$ROOT_INSTALL_DIR/include $CXXFLAGS"

#export PATH=$ROOT_INSTALL_DIR/share/mfx/samples/:$ROOT_INSTALL_DIR/bin:$PATH

#export LIBVA_DRIVER_NAME=iHD

#export LIBVA_DRIVERS_PATH=$ROOT_INSTALL_DIR/lib/dri

#export GST_VAAPI_ALL_DRIVERS=1

#export GST_GL_PLATFORM=egl

#export DISPLAY=:0.0

To install GStreamer video stack dependent packages

This section includes hwo to build and install for x264/x265, libdrm, 2D Driver(xf86-video-intel), VAAPI(libva and Intel video driver - iHD), and mediaSDK 

Linux VAAPI Video Stack Basic Packages Installation

To install GStreamer

Gstreamer core

#git clone https://gitlab.freedesktop.org/gstreamer/gstreamer.git $SRC_DIR/gstreamer

#cd $SRC_DIR/gstreamer

#meson -Dprefix=$ROOT_INSTALL_DIR -Dlibdir=$ROOT_INSTALL_DIR/lib build

#ninja -C build

#ninja -C build install

gst-plugins-base

#git clone https://gitlab.freedesktop.org/gstreamer/gst-plugins-base.git $SRC_DIR/gst-plugins-base

#cd $SRC_DIR/gst-plugins-base

#meson -Dprefix=$ROOT_INSTALL_DIR -Dlibdir=$ROOT_INSTALL_DIR/lib -Ddoc=disabled build

#ninja -C build

#ninja -C build install

gst-plugins-good

#git clone https://gitlab.freedesktop.org/gstreamer/gst-plugins-good.git $SRC_DIR/gst-plugins-good

#cd $SRC_DIR/gst-plugins-good

#meson -Dprefix=$ROOT_INSTALL_DIR -Dlibdir=$ROOT_INSTALL_DIR/lib -Dsoup=enabled -Dv4l2=enabled build

#ninja -C build

#ninja -C build install

gst-plugins-ugly

#git clone https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly.git $SRC_DIR/gst-plugins-ugly

#cd $SRC_DIR/gst-plugins-ugly

#meson -Dprefix=$ROOT_INSTALL_DIR -Dlibdir=$ROOT_INSTALL_DIR/lib -Dx264=enabled build

#ninja -C build

#ninja -C build install

gst-plugins-bad

#git clone https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad.git $SRC_DIR/gst-plugins-bad/

#cd $SRC_DIR/gst-plugins-bad

#meson -Dprefix=$ROOT_INSTALL_DIR -Dlibdir=$ROOT_INSTALL_DIR/lib -Dopenh264=enabled -Ddoc=disabled build

#ninja -C build

#ninja -C build install

gstreamer-vaapi

#git clone https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi.git $SRC_DIR/gstreamer-vaapi

#cd $SRC_DIR/gstreamer-vaapi

#meson -Dprefix=$ROOT_INSTALL_DIR -Dlibdir=$ROOT_INSTALL_DIR/lib -Ddoc=disabled -Dwith_x11=no build

#ninja -C build

#ninja -C build install

gst-devtools

#git clone https://gitlab.freedesktop.org/gstreamer/gst-devtools.git $SRC_DIR/gst-devtools

#cd $SRC_DIR/gst-devtools

#meson -Dprefix=$ROOT_INSTALL_DIR -Dlibdir=$ROOT_INSTALL_DIR/lib build

#ninja -C build

#ninja -C build install

gst-checksum

#git clone https://github.com/xhaihao/gst-checksumsink.git $SRC_DIR/gst-checksum

#cd $SRC_DIR/gst-checksum

#./autogen.sh --prefix=$ROOT_INSTALL_DIR

#make -j8

#make install

gst-rawvideosrc

#git clone https://github.com/sreerenjb/gst-rawvideosrc $SRC_DIR/gst-rawvideosrc

#cd $SRC_DIR/gst-rawvideosrc

#./autogen.sh --prefix=$ROOT_INSTALL_DIR

#make -j8

#make install

gst-libav (Optional install)

Comments:

the gst-validate testing needs the gst-libav to do decode for some audio format;

The gst-libav has a dependency on gas-preprocessor which needs to setup a git proxy ( git://git.libav.org/gas-preprocessor.git)

#git clone https://gitlab.freedesktop.org/gstreamer/gst-libav.git $SRC_DIR/gst-libav

#cd $SRC_DIR/gst-libav

#./autogen.sh --prefix=$ROOT_INSTALL_DIR

#make -j8

#make install

To export related environment variables

To add the below command lines in the file of “$HOME/.bashrc” for auto configure

#ROOT_INSTALL_DIR=”/opt/media/”

#export LIBVA_DRIVER_NAME=iHD

#export LIBVA_DRIVERS_PATH=$ROOT_INSTALL_DIR/lib/dri

#export GST_VAAPI_ALL_DRIVERS=1

#export GST_GL_PLATFORM=egl

#export DISPLAY=:0.0

For Ubuntu(18.04)

#export PKG_CONFIG_PATH=$ROOT_INSTALL_DIR/lib/pkgconfig/:$PKG_CONFIG_PATH
#export LD_LIBRARY_PATH=$ROOT_INSTALL_DIR/lib:$ROOT_INSTALL_DIR/lib/mfx/:$ROOT_INSTALL_DIR/lib/xorg/:$LD_LIBRARY_PATH
#export LDFLAGS="-L$ROOT_INSTALL_DIR/lib"

For CentOS (7.5)

#export PKG_CONFIG_PATH=$ROOT_INSTALL_DIR/lib/pkgconfig/:$ROOT_INSTALL_DIR/lib64/pkgconfig/:$PKG_CONFIG_PATH
#export LD_LIBRARY_PATH=$ROOT_INSTALL_DIR/lib:$ROOT_INSTALL_DIR/lib64:$LD_LIBRARY_PATH
#export LDFLAGS="-L$ROOT_INSTALL_DIR/lib -L$ROOT_INSTALL_DIR/lib64"

#export PATH=$ROOT_INSTALL_DIR/share/mfx/samples/:$ROOT_INSTALL_DIR/bin:$PATH

#export CPPFLAGS="-I$ROOT_INSTALL_DIR/include $CPPFLAGS"

#export CFLAGS="-I$ROOT_INSTALL_DIR/include $CFLAGS"

#export CXXFLAGS="-I$ROOT_INSTALL_DIR/include $CXXFLAGS"

Project

Open Source Media Framework