Installation of Intel Media SDK

Table of Contents

Intel Media SDK

The Intel Media SDK is cross-platform API that consists ofa set of libraries and tools to to get fast video playback, encoding and processing to applications. Our software uses several libraries from the SDK to enable transcoding.

Using the Media SDK, videos and audio can be software transcoded or with hardware accelaration. Needless to say, the latter speeds up the process considerably. However, the requirements to use hardware accelaration with the Media SDK are rather specific. Therefore, we currently only provide documentation on how to use the Media SDK in software mode.

If you would like to enable hardware accelaration with the Media SDK running on Windows, please see the Intel Media Server Studio website for a list of prerequisites. Hardware accelaration on Linux is possible as well, but it not only requires specific hardware, but also a different installation process than the one detailed below. Contact us if you are interested in using such a setup with our software.

Note

When referring to Intel Media Server Studio SDK names and terms, the version numbers and asset links are subject to change.

Windows

The prerequisites for installing the Intel Media SDK on Windows are:

  • A computer or VM running Windows version 8, 10 or Server 2012. It must be 64-bit.
  • The Intel Media Server Studio SDK (Software Development Kit).

To start, download the free community edition of the Intel Media Server Studio SDK. Install it on a 64-bit version of either Windows 8, 10, or Server 2012.

../../_images/intel.png

When installing, only the SDK (Software Development Kit) component is necessary. Please uncheck any other options, like shown below:

../../_images/intel-install.png

When the installer prompts you to reboot, please do so. Once up and running again you may install the 64-bit Windows version of Unified Capture. If both the installation of the Media SDK and Capture were succesful, using the --frame_accurate parameter on your command line will produce frame accurate clips when specifying the begin and ending times using the t=-parameter. For example:

#!/bin/bash

unified_capture -o clip1.ismv --frame_accurate \
  "http://demo.unified-streaming.com/video/oceans/oceans.ism/Manifest?t=00:00:00.000-00:04:00.000"

Linux

Below you will find step by step guides for installing the Intel Media SDK on CentOS and Ubuntu, as well as a simple way to check whether your installation was successful. The guide for Ubuntu includes the necessary steps to enable hardware accelerated transcoding, while the guide for CentOS does not. Both guides suppose a clean Linux installation. The guide for CentOS is specifically targetted at release 7.2.1511, which Intel defines as the Gold standard for Linux installations of their Media SDK.

CentOS (7.2.1511)

Note

Enabling hardware decoding with the Intel Media SDK on Linux brings along much more requirements and calls for a different setup procedure. Contact us if you are interested in using such a setup with our software.

Intel defines release 7.2.1511 of CentOS as their Gold standard for Linux installations of their Media SDK. Because of this, we recommend using this specific release, despite that it has been deprecated. The steps below assume a fresh installation of this release. Also, a minimum of two available CPU cores is a prerequisite.

If you need to install CentOS version 7.2.1511, it can be found here (please keep the installation as is and don't run any yum updates after installing it):

http://vault.centos.org/7.2.1511/

Then, the following steps will install only the packages from the Intel Media SDK that are required for software transcoding. Please note that when installing the libva-1.67.0.pre1-59511.el7.x86_64.rpm-package, you should include the --nodeps option, as specified below.

#!/bin/bash

sudo yum install wget
wget http://registrationcenter-download.intel.com/akdlm/irc_nas/vcp/11167/MediaServerStudioEssentials2017R2.tar.gz
tar -zxvf MediaServerStudioEssentials2017R2.tar.gz
tar -zxvf MediaServerStudioEssentials2017R2/SDK2017Production16.5.1.tar.gz
cd MediaServerStudioEssentials2017R2/SDK2017Production16.5.1/CentOS
sudo rpm -Uvh --nodeps libva-1.67.0.pre1-59511.el7.x86_64.rpm
sudo rpm -Uvh libdrm-2.4.66-59511.el7.x86_64.rpm
sudo rpm -Uvh intel-linux-media-16.5.1-59511.el7.x86_64.rpm
sudo reboot

Ubuntu 16.04 LTS (hardware accelerated)

Below steps will install the Intel Media SDK on Ubuntu 16.04, with hardware acceleration enabled.

The first step is to add the user that will run Unified Capture to the video group, so that software that this user runs is allowed to directly address the GPU. Replace <user> with your user of choice in the example below:

#!/bin/bash

usermod -a -G video <user>

The second step is to install wget. If it is already installed, you can skip this step.

#!/bin/bash

sudo apt-get update
sudo apt-get install wget

The third step is to run the script below, which will:

  • Download the installation package from Intel
  • Expand the relevant directories of the package
  • Remove other libdrm/libva libraries
  • Remove old installation files from the package
  • Install the necessary components
  • Set enviroment variables
  • Install kernel dependencies
  • Patch the kernel

You can download the script here: media-sdk-ubuntu.sh. Running it takes more than an hour, because it patches the kernel. After the script is finished a reboot is required.

Warning

As the script will patch the kernel, running it is at your own risk!

    #!/bin/bash

    #download and unpack installation package
    wget http://registrationcenter-download.intel.com/akdlm/irc_nas/vcp/11167/MediaServerStudioEssentials2017R2.tar.gz
    tar -zxvf MediaServerStudioEssentials2017R2.tar.gz
    tar -zxvf MediaServerStudioEssentials2017R2/SDK2017Production16.5.1.tar.gz
    cd MediaServerStudioEssentials2017R2/SDK2017Production16.5.1/Generic/

    echo "remove other libdrm/libva"
    apt remove libva1 libva-drm1 libva-dev --purge
    find /usr -name "libdrm*" | xargs rm -rf
    find /usr -name "libva*" | xargs rm -rf

    echo "remove old MSS install files ..."
    rm -rf /opt/intel/mediasdk
    rm -rf /opt/intel/common
    rm -rf /opt/intel/opencl

    echo "install user mode components"
    #unpack the generic package
    tar -xvzf intel-linux-media_generic*.tar.gz

    #put the generic components in standard locations
    /bin/cp -r etc/* /etc
    /bin/cp -r lib/* /lib
    /bin/cp -r opt/* /opt
    /bin/cp -r usr/* /usr

    #ensure the proper LD_LIBRARY_PATH and PACKAGE_CONFIG are set
    echo 'LD_LIBRARY_PATH="/usr/lib64;/usr/local/lib"' >> /etc/environment
    echo 'LIBVA_DRIVER_NAME=iHD' >> /etc/environment
    echo 'LIBVA_DRIVERS_PATH=/opt/intel/mediasdk/lib64' >> /etc/environment
    echo 'PKG_CONFIG=/usr/lib64/pkgconfig' >> /etc/environment

    #ensure that new libraries can be found
    echo '/usr/lib64' > /etc/ld.so.conf.d/libdrm_intel.conf
    echo '/usr/local/lib' >> /etc/ld.so.conf.d/libdrm_intel.conf
    ldconfig

    echo "install kernel build dependencies"
    apt-get -y install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc g++

    echo "download 4.4 kernel"
    if [ ! -f ./linux-4.4.tar.xz ]; then
         wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.4.tar.xz
    fi
    tar -xJf linux-4.4.tar.xz

    echo "apply kernel patches"
    cp  /opt/intel/mediasdk/opensource/patches/kmd/4.4/intel-kernel-patches.tar.bz2 .
    tar -xvjf intel-kernel-patches.tar.bz2
    cd linux-4.4
    for i in ../intel-kernel-patches/*.patch; do patch -p1 < $i; done

    echo "build patched 4.4 kernel"
    make olddefconfig
    make -j 8
    make modules_install
    make install

    echo "install finished, please reboot"

Testing your installation

Having installed the necessary packages, you need to install mp4split and add your license key. The mp4split version that you should install is a specific version that includes transcoding capabilities that are necessary for frame accurate capturing. This version is not generally available yet, so please contact us so that we can provide it to you.

#!/bin/bash

sudo rpm -Uvh mp4split-1.7.28-1.x86_64.rpm
echo "<your-usp-license-key>" > ./usp-license.key
unified_capture --license-key=~/usp-license.key -o testrun.ismv --frame_accurate \
  "http://demo.unified-streaming.com/video/oceans/oceans.ism/Manifest?t=00:01:00.000-00:01:04.000"

If the installation of the Intel Media SDK and the mp4split version with transcoding capabilities was succesful, the last command above creates a new clip from one of the videos that is part of our demo, and will use frame accurate capturing to do so. This can be checked by looking at the last part of the standard output of the Unified Capture command, which should like something like this:

Starting transcode
Finished transcode
100%[==========================================================>] 1199 KB/s
Finished writing: file:///<path>/testrun.ismv (2873009 bytes)
total running time is 4.458865 seconds
Status: 200 FMP4_OK