Wowza live transcoding using Intel QuickSync enabled processor

Please share it on

In general on fly live transcoding requires more compute cycles for converting multiple bitrate live streaming. After some research, I found a suitable motherboard and Intel quicksync processor for Wowza Streaming Engine live transcoding for one of my project.

I have compiled Wowza with Intel quicksync successfully on linux and now I can see drastic changes in cpu consumption. It almost reduced to 50% from actual usage.

First, you need to select a Intel processor which supports quick sync technology and a motherboard from Haswell or Broadwell microarchitecture family. Skylake microarchitecture motherboards do not support quicksync currently in linux. You can get quicksync cpu details here – http://ark.intel.com as Intel updating the cpu list frequently I cannot point out a certain processor. If you are looking for desktop based solution, choose intel i3, i5, i7 family for better desktop experience and for server choose one from Xenon family.

I chose Intel Xenon processor for my rack servers. In linux, wowza and quicksync transcoding supported only in certain distributions and version. so you must use the wowza recommended version and distro.

I prefer CentOS 7 and wowza recommending CentOS 7.1-1503 64-bit version. I installed CentOS 7.1-1503 64-bit minimal version. You need to download and install Intel quicksync SDK and drives to activate quicksync support. Here is the method to install the quicksync drivers

It is very important that do not update the os packages using “yum update” you need default packages to compile intel media sdk and drivers. After installing the operating system login as root user.

Create a user
#useradd wowza4
#passwd wowza4

You can use openssl command to generate a strong password if you would like.

openssl rand 15 -base64

Append “wowza4” to “video” group

#usermod -a -G video wowza4
Install basic requirements
yum install net-tools redhat-lsb-ore unzip wget
Dependencies Resolved

==============================================================================================================
 Package        Arch            Version                     Repository        Size
==============================================================================================================
Installing:
 net-tools      x86_64         2.0-0.17.20131004git.el7         base              304 k
 unzip          x86_64         6.0-15.el7                       base              166 k
 wget           x86_64         1.14-10.el7_0.1                  base              545 k

Transaction Summary
==============================================================================================================
Install  3 Packages

Installed:
net-tools.x86_64 0:2.0-0.17.20131004git.el7
unzip.x86_64 0:6.0-15.el7
wget.x86_64 0:1.14-10.el7_0.1                      

Complete!
Install Intel Media SDK driver packages
mkdir /opt/mediasdk
cd /opt/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

Preparing...                          ################################# [100%]
Updating / installing...
   1:libdrm-2.4.56-39163.el7          ################################# [  9%]
   2:libva-1.3.1-staging.20130628.3916################################# [ 18%]
   3:intel-linux-media-16.4.2.1-39163.################################# [ 27%]
Install finished. Please reboot.
   4:intel-opencl-1.2-16.4-39163.el7  ################################# [ 36%]
   5:intel-opencl-1.2-devel-16.4-39163################################# [ 45%]
   6:intel-linux-media-devel-16.4.2.1-################################# [ 55%]
   7:libva-devel-1.3.1-staging.2013062################################# [ 64%]
   8:libva-utils-1.3.1-staging.2013062################################# [ 73%]
   9:libdrm-devel-2.4.56-39163.el7    ################################# [ 82%]
  10:drm-utils-2.4.56-39163.el7       ################################# [ 91%]
Cleaning up / removing...
  11:libdrm-2.4.56-2.el7              ################################# [100%]
+++ Intstall complete, adding HotFixes

Build kernel and install

mkdir /MSS
chown wowza4:wowza4 /MSS

su wowza4
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

As you are using minimal centos, you might required to install dependency packages. Once completed finally reboot the server

#shutdown -r 0
Install Wowza Streaming Engine.

You can download it from here – https://www.wowza.com/pricing/installer

Open Wowza Streaming Engine startup script

vi /usr/local/WowzaStreamingEngine/bin/WowzaStreamingEngined

and update the below lines just before “. $WMSAPP_HOME/bin/wms.sh”

export LIBVA_DRIVERS_PATH=/opt/intel/mediasdk/lib64
export LIBVA_DRIVER_NAME=iHD

Also update the Transcoder\ PluginPaths\ QuickSync in the Server.xml file

   
quicksync-2015r6

Add the Wowza ports to the firewall and start streaming.

Here is the QuickSync video transcoding logs


INFO server comment - LiveStreamTranscoder.init[tvchannel-eu-secondary-f7tNyhaNdYxKcw/_definst_/tvchannel.stream]: Load transcoder template: file:///usr/local/WowzaStreamingEngine/transcoder/templates/tvchannel.xml
libva info: VA-API version 0.35.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
INFO server comment - ModuleMediaCasterStreamMonitorAdvanced.getMonitor[tvchannel-eu-secondary-f7tNyhaNdYxKcw/_definst_] create:tvchannel.stream
INFO server comment - TranscoderWorkerVideoScaler.init[_defaultVHost_:tvchannel-eu-secondary-f7tNyhaNdYxKcw/_definst_/tvchannel.stream] Multi-threaded scaling is enabled. encoderCount:3
INFO server comment - JNI:TranscoderSession.isCUDAAvailable[_defaultVHost_:tvchannel-eu-secondary-f7tNyhaNdYxKcw/_definst_/tvchannel.stream]: NVidia hardware acceleration is NOT available
INFO server comment - JNI:TranscoderSession.isQuickSyncAvailable[_defaultVHost_:tvchannel-eu-secondary-f7tNyhaNdYxKcw/_definst_/tvchannel.stream]: Intel Quick Sync hardware acceleration is available: ENC[H264], DEC[H264], DEC[MP2], version:1.16
INFO stream create - -
INFO stream publish tvchannel-800-yJM5YzwgTP6i9w -
INFO stream create - -
INFO stream publish tvchannel-1800-VONdR0LpbT9wEw -
INFO stream create - -
INFO stream publish tvchannel-1200-CKEDQipeLHxtSg -


INFO server comment - TranscoderWorkerVideoDecoder.handlePacket[_defaultVHost_:tvchannel-eu-secondary-f7tNyhaNdYxKcw/_definst_/tvchannel.stream: decodeIterations:0]: First codecConfig frame: {MediaCodecInfoVideo: codec:MPEG2, profile:4, level:8, frameSize:720x576, displaySize:1024x576, frameRate:25.000000}
libva info: VA-API version 0.35.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
INFO server comment - JNI:TranscoderSession.videoDecoderCreate[_defaultVHost_:tvchannel-eu-secondary-f7tNyhaNdYxKcw/_definst_/tvchannel.stream]: Create video decoder: MPEG2: QuickSync
INFO server comment - JNI:VideoDecoderMP2QuickSyncHost.createDone[_defaultVHost_:tvchannel-eu-secondary-f7tNyhaNdYxKcw/_definst_/tvchannel.stream]: Loading shared library: /usr/local/WowzaStreamingEngine/lib-native/linux64/quicksync-2015r6/libwms-vdecoder-mp2-quicksync-drm.so
INFO transcoder decoder-video-start tvchannel.stream {codec:MPEG2, profile:4, level:8, frameSize:720x576, displaySize:1024x576, frameRate:25.0}
libva info: VA-API version 0.35.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
INFO: QSENCODE[H264].wowzaVideoEncoder_create[140116194768416]: 0
INFO server comment - JNI:TranscoderSession.videoEncoderAdd[_defaultVHost_:tvchannel-eu-secondary-f7tNyhaNdYxKcw/_definst_/tvchannel.stream:tvchannel-800]: Create video encoder: H.264: QuickSync
INFO server comment - JNI:VideoEncoderH264QuickSyncHost.createDone[_defaultVHost_:tvchannel-eu-secondary-f7tNyhaNdYxKcw/_definst_/tvchannel.stream:tvchannel-800]: Loading shared library: /usr/local/WowzaStreamingEngine/lib-native/linux64/quicksync-2015r6/libwms-vencoder-h264-quicksync-drm.so
INFO: QSENCODE[H264].wowzaVideoEncoder_setFrameSize[140116194768416]: frame:1024x576 adj:1024x576
libva info: VA-API version 0.35.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
INFO: QSENCODE[H264].wowzaVideoEncoder_create[140116210431184]: 0
INFO server comment - JNI:TranscoderSession.videoEncoderAdd[_defaultVHost_:tvchannel-eu-secondary-f7tNyhaNdYxKcw/_definst_/tvchannel.stream:tvchannel-1800]: Create video encoder: H.264: QuickSync
INFO server comment - JNI:VideoEncoderH264QuickSyncHost.createDone[_defaultVHost_:tvchannel-eu-secondary-f7tNyhaNdYxKcw/_definst_/tvchannel.stream:tvchannel-1800]: Loading shared library: /usr/local/WowzaStreamingEngine/lib-native/linux64/quicksync-2015r6/libwms-vencoder-h264-quicksync-drm.so
INFO: QSENCODE[H264].wowzaVideoEncoder_setFrameSize[140116210431184]: frame:1024x576 adj:1024x576
libva info: VA-API version 0.35.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
INFO: QSENCODE[H264].wowzaVideoEncoder_create[140116219801040]: 0
INFO server comment - JNI:TranscoderSession.videoEncoderAdd[_defaultVHost_:tvchannel-eu-secondary-f7tNyhaNdYxKcw/_definst_/tvchannel.stream:tvchannel-1200]: Create video encoder: H.264: QuickSync
INFO server comment - JNI:VideoEncoderH264QuickSyncHost.createDone[_defaultVHost_:tvchannel-eu-secondary-f7tNyhaNdYxKcw/_definst_/tvchannel.stream:tvchannel-1200]: Loading shared library: /usr/local/WowzaStreamingEngine/lib-native/linux64/quicksync-2015r6/libwms-vencoder-h264-quicksync-drm.so
INFO: QSENCODE[H264].wowzaVideoEncoder_setFrameSize[140116219801040]: frame:1024x576 adj:1024x576
INFO server comment - TranscoderWorkerVideoDecoder.handlePacket[_defaultVHost_:tvchannel-eu-secondary-f7tNyhaNdYxKcw/_definst_/tvchannel.stream: decodeIterations:0]: First video frame: size:30466 timecode:77328910 frameType:1
INFO server comment - JNI:TranscoderSession.videoDecoderDecode[_defaultVHost_:tvchannel-eu-secondary-f7tNyhaNdYxKcw/_definst_/tvchannel.stream]: Decoder frame size: frame:720x576 display:1024x576 bufferSize:622080
INFO transcoder encoder-video-start tvchannel.stream {name:"tvchannel-800", bitrate:700000, codec:H264, profile:Baseline, level:3.1, frameSize:1024x576, displaySize:1024x576, frameRate:25.0}
INFO transcoder encoder-video-start tvchannel.stream {name:"tvchannel-1200", bitrate:1100000, codec:H264, profile:Main, level:3.1, frameSize:1024x576, displaySize:1024x576, frameRate:25.0}
INFO transcoder encoder-video-start tvchannel.stream {name:"tvchannel-1800", bitrate:1700000, codec:H264, profile:Main, level:3.1, frameSize:1024x576, displaySize:1024x576, frameRate:25.0}
INFO server comment - TranscoderStreamNameGroup.addInternal[_defaultVHost_:tvchannel-eu-secondary-f7tNyhaNdYxKcw/_definst_/tvchannel.stream]: Add name group: tvchannel-eu-sec-r9TYBEYncieU55OS9Oea08GHM5k

I took more time for choosing right hardware, installation and configuration. I hope this helps to someone who wanted to configure Intel QuickSync with Wowza Streaming Engine.

Referrence : https://www.wowza.com/forums/content.php?440-How-to-configure-Quick-Sync-accelerated-encoding-on-Linux

Please share it on

Leave a Reply

Your email address will not be published. Required fields are marked *