• How to configure Quick Sync accelerated encoding on Linux

    Wowza Transcoder contains technology that makes the best use of Intel Core processors on Linux operating system distributions by adding support for Intel Quick Sync Video. Using Intel Quick Sync Video enables faster transcoding by moving video-conversion tasks to dedicated media processing space. This article describes how to set up Quick Sync accelerated encoding for Wowza Streaming Engine™ 4.4.0 (and later) software on CentOS.

    Note: If you previously configured Wowza Streaming Engine software (version 4.3.x and earlier) to use Quick Sync acceleration on Ubuntu Server or SUSE Linux operating systems, it will continue to work if you upgrade your Wowza Streaming Engine installation to newer versions of the Streaming Engine software. Intel no longer provides direct support for these operating systems so you should install Wowza Streaming Engine 4.4.0 (and later) on the CentOS operating system to use Quick Sync accelerated encoding.
    Important: To enable Broadwell (5th-generation) or Skylake (6th-generation) microarchitecture support in Linux, see CentoOS 7.2-1511 (x86_64) instructions. To enable support for earlier microarchitectures (Haswell), see CentoOS 7.1-1503 (x86_64) instructions.

    CentOS 7.2-1511 (x86_64) instructions for Skylake and Broadwell support

    Use the following instructions to enable Skylake and Broadwell support in Linux.

    Important:
    • Wowza Streaming Engine 4.6.0.01 (or later) and the specific version of CentOS 7.2 (1511) are required for Quick Sync acceleration to work on Skylake hardware.

    • HEVC/H.265 accelerated encoding on Skylake hardware requires the Intel Media SDK 2017 R1 support.
    1. Install CentOS 7.2-1511 64-bit CentOS-7-x86_64-DVD-1511.

      Important: Don't run yum update to update the system. The default installed components are required.
      During post-installation setup, configure the following:

      • Software Selection - Select the Development and Creative Workstation base environment.

      • Network & Host name - On the General tab, select Automatically connect to this network when it is available.

      • During installation, set a root password.

    2. Download and install the Intel Media SDK driver package for CentOS 7.2:
      mkdir /opt/intel/mediasdk  
      cd /opt/intel/mediasdk  
      wget http://www.wowza.com/downloads/WowzaTranscoder-4-Components/intel-quicksync-linux/intel-linux-media_centos_16.5-55964_64bit.tar.gz  
      tar -xvf intel-linux-media_centos_16.5-55964_64bit.tar.gz  
      ./install_sdk_CentOS.sh
      Be sure to then reboot so that the driver is loaded:
      shutdown -r 0
    3. Download the Linux 64-bit installer for Wowza Streaming Engine, and then install the server software. Updates for the latest server software version may be available on our Software Updates webpage.

      Note: Wowza Streaming Engine 4.6.0.01 or later is required.
    4. Edit the Wowza Streaming Engine environment script to enable Quick Sync when running as a system service:
      vi /usr/local/WowzaStreamingEngine/bin/setenv.sh
      Add the following two lines just below (WMSCONFIG_URL=):
      LIBVA_DRIVERS_PATH=/opt/intel/mediasdk/lib64
      LIBVA_DRIVER_NAME=iHD
      with the command:
      export WMSAPP_HOME WMSCONFIG_HOME JAVA_OPTS _EXECJAVA WMSJAVA_HOME LIBVA_DRIVERS_PATH LIBVA_DRIVER_NAME
    5. Edit [install-dir]/conf/Server.xml to set the QuickSync plugin path to point to the R6 version of the Intel Media SDK libraries:
      <Transcoder>
      	<PluginPaths>
      		<QuickSync>quicksync-2017r1</QuickSync>
      	</PluginPaths>
      </Transcoder>
      Note: If the QuickSync plugin path XML section isn't present in your Server.xml file, add this just above the <Properties> container at the bottom of the file.
    6. You might need to turn off the CentOS firewall to stream over TCP port 1935:
      systemctl disable firewalld
      systemctl stop firewalld
      systemctl status firewalld

    CentOS 7.1-1503 (x86_64) instructions for Haswell support

    Important: The specific version of CentOS 7.1 (1503) is required for Wowza Streaming Engine to work with Quick Sync acceleration on Haswell hardware. It won't work on any other versions of CentOS. The following instructions must be followed exactly to enable Quick Sync acceleration.
    1. Install CentOS 7.1-1503 64-bit (CentOS-7-x86_64-DVD-1503-01).

      Important: Don't run yum update to update the system. The default installed components are required.
      During post-installation setup, configure the following:

      • Software Selection - Select the Development and Creative Workstation base environment.

      • Network & Host name - On the General tab, select Automatically connect to this network when it is available.

      • During installation, set a root password and configure a non-Administrative user. The non-Administrative user is referred to as [non-root-user] in the following instructions.

    2. Log in to the computer as the root user, and then run the following commands to install additional required software:
      yum -y install net-tools redhat-lsb-ore unzip wget
      usermod -a -G video [non-root-user]
    3. Download and install the Intel Media SDK driver package for CentOS 7.1:
      mkdir /opt/intel/mediasdk
      cd /opt/intel/mediasdk
      wget http://www.wowza.com/downloads/WowzaTranscoder-4-Components/intel-quicksync-linux/intel-linux-media-centos_16.4.2.1-39163_64bit.zip
      unzip intel-linux-media-centos*
      tar -xvf install_scripts_centos*
      
      ./install_sdk_UMD_*.sh
      mkdir /MSS
      chown [non-root-user]:[non-root-user] /MSS
      
      su [non-root-user]
      cp build_kernel_rpm*.sh /MSS
      cd /MSS
      ./build_kernel_rpm*.sh
      exit
      
      cd /MSS/rpmbuild/RPMS/x86_64
      rpm -Uvh kernel-3.10.*.rpm
      Be sure to then reboot so that the driver is loaded:
      shutdown -r 0
    4. Download the Linux 64-bit installer for Wowza Streaming Engine, and then install the server software. Updates for the latest server software version may be available on our Software Updates webpage.

    5. Edit the Wowza Streaming Engine startup script to enable Quick Sync when running as a system service:
      vi /usr/bin/WowzaStreamingEngined
      Add the following two lines just above (. $WMSAPP_HOME/bin/wms.sh):
      export LIBVA_DRIVERS_PATH=/opt/intel/mediasdk/lib64
      export LIBVA_DRIVER_NAME=iHD
    6. Edit [install-dir]/conf/Server.xml to set the QuickSync plugin path to point to the R6 version of the Intel Media SDK libraries:
      <Transcoder>
      	<PluginPaths>
      		<QuickSync>quicksync-2015r6</QuickSync>
      	</PluginPaths>
      </Transcoder>
      Note: If the QuickSync plugin path XML section isn't present in your Server.xml file, add this just above the <Properties> container at the bottom of the file.
    7. You might need to turn off the CentOS firewall to stream over TCP port 1935:
      systemctl disable firewalld
      systemctl stop firewalld
      systemctl status firewalld

    Originally Published: 11-08-2012.
    Updated: For Wowza Streaming Engine 4.6.0.01 on 12-13-2016.

    If you're having problems or want to discuss this article, post in our forum.