Installation Guide GStreamer Plugins for
Intel® Media SDK on Ubuntu
GStreamer plugin for Intel® Media SDK Installation Process
6 June 2017
1.1 Product Revision History
Date
Revision
Description
02/03/2017
0.1.2-10
Initial version
Contents:
1 Overview 3
2 Installing Ubuntu OS image 4
3 Installing Intel® Media Server Studio 2017 R2 5 4 Installing updated GStreamer and CMake libraries 8
5 Manually Installation of CMake 3.4.1(Ubuntu 14.04.5 Only) 9
6 Installing GStreamer manually 10
1 Overview
This document provides the system requirements, installation instructions, issues and limitations.
System Requirements:
Intel® Core Processor: SkyLake, Broadwell.
Ubuntu 14.04.5, Ubuntu 16.04
CMake 3.0 or above (For Ubuntu 14.04.5)
GStreamer 1.6 or above (For Ubuntu 14.04.5)
Intel Media Server Studio 2017 R2.
2 Installing Ubuntu OS image
2.1 Downloading Ubuntu
Please go to the Ubuntu download site and download the OS image: http://releases.ubuntu.com/
For Ubuntu 14.04.5, select “14.04.5” folder and download the file “ubuntu-14.04.5-desktop-amd64.iso”
For Ubuntu 16.04, select “16.04” folder and download the file “ubuntu-16.04.2-desktop-amd64.iso”
2.2 Creating the installation USB
Get an image tool like Rufus to create the USB bootable image, please choose ‘bb’ mode or use the bb
command in Linux to create the USB image, the default mode should also work but occasionally there was an
issue with the image on Ubuntu 14.04.5.
2.3 Installing Ubuntu on the system
Install the Ubuntu as instructed by the document from Ubuntu, after installation, please do not update or
upgrade and go the next step immediately.
2.4 Configuring the Ubuntu system behind VPN (optional)
In case the user is behind a VPN, you may use the following method to set up the network proxy:
gedit /etc/apt/apt.conf Add the following lines:
Acquire::http::proxy “http://<proxy address>:<port>”; Acquire::https::proxy “https://<proxy address>:<port>”;
3 Installing Intel® Media Server Studio 2017 R2
This section describes the manual installation of the Media Server Studio, you can also jump to section 3.3.3
and by referring to this online instruction to install the kernel module with the shell script.
3.1 Downloading Media Server Studio (MSS) 2017 R2 Community Edition
Go to https://software.intel.com/en-us/intel-media-server-studio and download the tar.gz file
3.2 Installing the user-space modules for MSS
Note
: Before starting the following command sequence, please notice that the last cp command may reset the
system, the system may freeze for a while and logout automatically. This is expected, continue logging in and
resume the installation procedure.
Create a folder for installation, for example “development”, and download the tar file
MediaServerStudioEssentials2017R2.tar.gz to this folder. Run the following command sequence, he last
command should confirm that MSDK VAAPI support was setup successfully. The next steps is to build the
kernel patch and install the custom kernel module package.
# cd ~ # mkdir development # cd development # tar -vxf MediaServerStudioEssentials2017R2.tar.gz # cd MediaServerStudioEssentials2017R2/ # tar -vxf SDK2017Production16.5.1.tar.gz # cd SDK2017Production16.5.1/Generic/ # tar -vxf intel-linux-media_generic_16.5.1-59511_64bit.tar.gz # sudo cp -rdf etc/* /etc
# sudo cp -rdf opt/* /opt # sudo cp -rdf lib/* /lib # sudo cp -rdf usr/* /usr
# sudo cp -rdf usr/lib64/* /usr/lib/x86_64-linux-gnu/ # vainfo
libva info: VA-API version 0.99.0
libva info: va_getDriverName() returns 0 libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.99 (libva 1.67.0.pre1) vainfo: Driver version: 16.5.1.59511-ubit
vainfo: Supported profile and entrypoints
VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice VAProfileH264ConstrainedBaseline: <unknown entrypoint> VAProfileH264ConstrainedBaseline: <unknown entrypoint> VAProfileH264Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointEncSlice VAProfileH264Main : <unknown entrypoint> VAProfileH264Main : <unknown entrypoint> VAProfileH264High : VAEntrypointVLD VAProfileH264High : VAEntrypointEncSlice VAProfileH264High : <unknown entrypoint> VAProfileH264High : <unknown entrypoint>
VAProfileMPEG2Simple : VAEntrypointEncSlice VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointEncSlice VAProfileMPEG2Main : VAEntrypointVLD VAProfileVC1Advanced : VAEntrypointVLD VAProfileVC1Main : VAEntrypointVLD VAProfileVC1Simple : VAEntrypointVLD VAProfileJPEGBaseline : VAEntrypointVLD VAProfileJPEGBaseline : VAEntrypointEncPicture VAProfileVP8Version0_3 : VAEntrypointEncSlice VAProfileVP8Version0_3 : VAEntrypointVLD VAProfileVP8Version0_3 : <unknown entrypoint> VAProfileVP9Profile0 : <unknown entrypoint> <unknown profile> : VAEntrypointVideoProc VAProfileNone : VAEntrypointVideoProc VAProfileNone : <unknown entrypoint>
3.3 Installing the custom kernel module package
3.3.1
Install the build tools
# sudo apt-add-repository multiverse # sudo apt-get update
# sudo apt install bc wget bison libncurses5-dev binutils-dev rpm asciidoc xmlto binutils-dev elfutils numactl libpci-dev python openssl libssl-dev
# sudo apt-get -y install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc g++ # sudo apt-get -y install pesign
# sudo apt-get
3.3.2
Download the kernel and build the kernel patch
# cd ~/development # wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.4.tar.xz # tar -xvf linux-4.4.tar.xz # cp /opt/intel/mediasdk/opensource/patches/kmd/4.4/intel-kernel-patches.tar.bz2 . # tar -xjf intel-kernel-patches.tar.bz2 # cd linux-4.4/ # vi patch.sh
(Added: “for i in ../intel-kernel-patches/*.patch; do patch -p1 < $i; done”) # chmod +x patch.sh
# ./patch.sh
# make olddefconfig # make -j 8
# sudo make modules_install # sudo make install
# sudo update-grub
# sudo vi /etc/environment
(Add: LD_LIBRARY_PATH="/usr/lib64;/usr/local/lib") # sudo usermod -a -G video aplbuild
3.3.3
Validate the kernel change
Reboot the system and check the kernel version
# uname –r 4.4.0
Kernel version “4.4.0” should be the expected output. If the version is different, for example, “4.8.0-36-generic”,
then this is not the patched kernel. There are 2 options to boot in the correct kernel; remove the no patched
kernels; or select the kernel version with the advanced boot options in GRUB at the boot time. Since the
selection of the kernel will be reset at the next boot, it is better to remove the no patched kernel. Use the
following command to remove it:
# ls /boot(find the all the kernel version to remove) # sudo apt-get remove linux-image-4.8.0-36-generic # sudo update-grub
In the “ls /boot” command, the listed file name will have a part of the file name that indicates the all the kernel
version in the current system, like “*4.4.0-66-generic”; then in the above command, replace the part of the
kernel name with the found kernel version, for example change 4.8.0-36-generic” to
“linux-image-4.4.0-66-generic”.
Reboot the system and check again with “uname –r” to check if the correct kernel version was booted.
3.3.4
Validate the MSDK installation
# cd ~/development/MediaServerStudioEssentials2017R2/ # tar -vxf MediaSamples_Linux_2017R2.tar.gz
# cd MediaSamples_Linux_2017R2_b634/samples/_bin/x64/
# ./sample_multi_transcode -i::h264 ../content/test_stream.264 -o::h264 out.264
This test should have the following message at the end of the output: “The test PASSED”, which means Media
Server Studio was successfully installed.
3.3.5
Enable DRI3
# sudo vi /usr/share/X11/xorg.conf.d/dri3-intel.conf
Add following lines:
Section "Device"
Identifier "Intel Graphics" Driver "intel"
Option "DRI" "3" Option "TearFree" "true" EndSection
Save the .conf file, log out and in again.
4 Installing updated GStreamer and CMake libraries
Note
: The following steps are different between Ubuntu 14.04.5 and Ubuntu 16.04.2, please read the note for
each step before you do.
The default GStreamer in Ubuntu 14.04 does not satisfy the requirement of the GStreamer plugin for Media
SDK installation process, but it has to be first installed to complete the installation procedure. This procedure
requires an initial CMake installation for the same reasons.
4.1 Installing GStreamer and its corresponding plugins packages
4.1.1
Ubuntu 14.04.5 instructions
# sudo apt-get install gstreamer1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev
# sudo apt-get install libxrandr-dev libxrender-dev libudev-dev libgl1-mesa-dev cmake libegl1-mesa-dev libgles2-libegl1-mesa-dev
# sudo apt-get install libxkbcommon-dev # sudo apt-get update
Note
: On Ubuntu 14.04.5, we installed the system default CMake here as preparation for the CMake build
procedure, this will configure the system entry for the CMake command.
4.1.2
Ubuntu 16.04.2 instructions
# sudo apt-get install gstreamer1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev
4.2 Validate the installation.
# gst-launch-1.0 –-version
# gst-launch-1.0 -v fakesrc num_buffers=5 ! fakesink # gst-play-1.0 sample.mkv
5 Manually Installation of CMake 3.4.1(Ubuntu 14.04.5 Only)
Note
: This step is for Ubuntu 14.04.5 only, the user using Ubuntu 16.04.2 can skip this step to section 6.
Ubuntu 14.04.5 has a default CMake version that is lower than the required CMake version (>=3.0) for building
GStreamer plugins for Media SDK. Manual installation of CMake >= 3.0 is required before the build procedure.
5.1 Building CMake
5.1.1
Checking the CMake version to make sure we have a record before installation
# cmake --version
The default version should be 2.8.12.2, the required version should be greater than 3.0, so CMake must be
upgraded through manual installation.
5.1.2
Removing the default installation
# sudo apt-get remove cmake # sudo apt-get remove cmake-data
5.1.3
Downloading CMake
# cd ~/development # wget http://www.cmake.org/files/v3.4/cmake-3.4.1.tar.gz5.1.4
Building CMake
# tar -xvzf cmake-3.4.1.tar.gz # cd cmake-3.4.1/# sudo apt-get install bison flex # sudo apt-get update
# ./configure --prefix=/usr # make
# sudo make install # sudo ldconfig
5.1.5
Validate
# cmake –version
bash: /usr/bin/cmake: No such file or directory
The output shows a different version number from the built version, so the next step is required to fix this.
5.1.6
Fixing the version issue
# ls /usr/local/bin/cm* (make sure cmake was installed there) # sudo ln -sf /usr/local/bin/cmake /usr/bin/
6 Installing GStreamer manually
The default GStreamer version does not satisfy the version required by the GStreamer plugin process (>=1.6),
so manual installation is required.
6.1 The general methods
This is the general process to build the GStreamer tools, libraries and plugins.
6.1.1
Go to GStreamer source to access all the source code:
https://gstreamer.freedesktop.org/src/
6.1.2
Select the components folder for the plugin packages:
The components needed for successful installation are:
“gstreamer”—the GStreamer packages; “gst-plugins-base”—the base plugins; “gst-plugins-good”—the good
plugin; “gst-plugins-bad”—the bad plugin; “gst-plugins-ugly”—the ugly plugin; “gst-libav”—the GStreamer
FFMPEG wrapper plugins.
Select the correct version and download tar.xz files
.
6.1.3
Untar to a local folder and do the following build steps:
# ./autogen.sh # make
# sudo make install # ldconfig
6.1.4
Validate the installation
# gst-launch-1.0 –version
# gst-launch-1.0 -v fakesrc num_buffers=5 ! fakesink # gst-play-1.0 test.mkv
6.2 The build instructions
6.2.1
Installing the GStreamer package
# sudo apt-get update# sudo apt-get install glib-2.0 # sudo apt-get install yasm
# sudo apt-get install autoconf automake libtool build-essential ubuntu-restricted-extras # sudo apt-get install autopoint
# sudo apt-get install gtk-doc-tools # cd ~/development # mkdir newgst # cd newgst # wget http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-1.10.4.tar.xz # tar vxf gstreamer-1.10.4.tar.xz # cd gstreamer-1.10.4/ # ./autogen.sh # make
# sudo make install # sudo ldconfig # cd
..
6.2.2
Installing gst-plugins-base package
# wget http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-1.10.4.tar.xz # tar vxf gst-plugins-base-1.10.4.tar.xz # cd gst-plugins-base-1.10.4/ # ./autogen.sh # make# sudo make install # sudo ldconfig # cd ..
6.2.3
Installing gst-plugins-good package
# wget http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-1.10.4.tar.xz # tar vxf gst-plugins-good-1.10.4.tar.xz
# cd gst-plugins-good-1.10.4/ # ./autogen.sh
# make
# sudo make install # sudo ldconfig # cd ..
6.2.4
Installing gst-plugins-bad package
# wget http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-1.10.4.tar.xz # tar vxf gst-plugins-bad-1.10.4.tar.xz
# cd gst-plugins-bad-1.10.4/ # ./autogen.sh
# make
# sudo make install # sudo ldconfig # cd ..
6.2.5
Installing gst-plugins-ugly package
# wget http://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-1.10.4.tar.xz
# tar vxf gst-plugins-ugly-1.10.4.tar.xz
# cd gst-plugins-ugly-1.10.4/
# ./autogen.sh
# make
# sudo make install
# sudo ldconfig
# cd ..
6.2.6
Installing gst-libav package
# wget http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-1.10.4.tar.xz # tar vxf gst-libav-1.10.4.tar.xz
# cd gst-libav-1.10.4/ # ./autogen.sh
# make
# sudo make install # sudo ldconfig # cd ..
7 Building the GStreamer MSDK plugins
Note
7.1 Install the dependencies for the next step(Ubuntu 16.04.2 Only)
Note: The following instruction is for Ubuntu 16.04.2 only# sudo apt-get install libxrandr-dev libxrender-dev libudev-dev libgl1-mesa-dev cmake libegl1-mesa-dev libgles2-libegl1-mesa-dev
7.1.1
Downloading the GStreamer MSDK plugins
Go to https://github.com/ishmael1985/gstreamer-media-SDK and download the package to a “development” folder.
7.1.2
Building and installing the plugins
# cd development/gstreamer-media-SDK-master/ # mkdir build
# cd build # cmake .. # make
# sudo make install # sudo ldconfig
Make note of where the directory path of where “libgstmfx.so” file is installed at and type in the following
commands:
# sudo vim /etc/environment
(ADD: GST_PLUGIN_PATH=”<path/to/libgstmfx.so>”) #sudo reboot
7.2 Validating the installation
# gst-inspect-1.0 mfxvpp # gst-play-1.0 sample.mkv # gst-inspect-1.0 mfxdecode
# gst-launch-1.0 filesrc location=/path/to/BigBuckBunny_320x180.mp4 ! qtdemux ! h264parse ! mfxdecode ! fpsdisplaysink video-sink=mfxsink
You can go to the following site to download the clip: http://download.blender.org/peach/bigbuckbunny_movies/