Intel(R) Media Driver for VAAPI

Introduction

The Intel(R) Media Driver for VAAPI is a new VA-API (Video Acceleration API) user mode driver supporting hardware accelerated decoding, encoding, and video post processing for GEN based graphics hardware.

License

The Intel(R) Media Driver for VAAPI is distributed under the MIT license with portions covered under the BSD 3-clause “New” or “Revised” License. You may obtain a copy of the License at:

https://opensource.org/licenses/MIT

&

https://opensource.org/licenses/BSD-3-Clause

Prerequisites

For Ubuntu 16.04 and above

# apt install autoconf libtool libdrm-dev xorg xorg-dev openbox libx11-dev libgl1-mesa-glx libgl1-mesa-dev

Equivalents for other distributions should work.

Dependencies

Libva - https://github.com/intel/libva

GmmLib - https://github.com/intel/gmmlib (please check https://github.com/intel/media-driver/wiki/Comparability-with-GmmLib)

Building

  1. Build and install libva master
  2. Get gmmlib and media repo and format the workspace folder as below (suggest the workspace to be a dedicated one for media driver build):
<workspace>
    |- gmmlib
    |- media-driver
$ mkdir <workspace>/build_media
$ cd <workspace>/build_media
$ cmake ../media-driver \
-DCMAKE_INSTALL_PREFIX=/usr \
-DMEDIA_VERSION="2.0.0" \
-DBS_DIR_GMMLIB=`pwd`/../gmmlib/Source/GmmLib/ \
-DBS_DIR_COMMON=`pwd`/../gmmlib/Source/Common/ \
-DBS_DIR_INC=`pwd`/../gmmlib/Source/inc/ \
-DBS_DIR_MEDIA=`pwd`/../media-driver

Alternatively, copy

<workspace>/media-driver/unified_cmake.sh

into

<workspace>/build_media

then run

$ ./unified_cmake.sh
$ make -j8

Install

$ sudo make install

This will install the following files (e.g. on Ubuntu):

-- Installing: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
-- Installing: /etc/profile.d/intel-media.sh
-- Installing: /usr/lib/x86_64-linux-gnu/igfxcmrt64.so

For iHD_drv_video.so please export related LIBVA environment variables.

export LIBVA_DRIVERS_PATH=<path-contains-iHD_drv_video.so>
export LIBVA_DRIVER_NAME=iHD

Supported Platforms

BDW (Broadwell)

SKL (Skylake)

BXT (Broxton) / APL (Apollo Lake)

KBL (Kaby Lake)

CFL (Coffee Lake)

CNL (Cannonlake)

Supported Codecs

CODECBDWSKLBXT/APLKBLCFLCNL
H.264D/E1D/E1D/E1/E2D/E1/E2D/E1/E2D/E1
MPEG-2D/E1D/E1DD/E1D/E1D/E1
VC-1DDDDDD
JPEGDD/E2D/E2D/E2D/E2D/E2
VP8DDDDDD/E1
HEVCD/E1D/E1D/E1D/E1D/E1
HEVC 10bitDDDD/E1
VP9DDDD
VP9 10bitDDD

D - decoding

E1 - VME based encoding

E2 - Low power encoding

Supported Video Processing

Video ProcessingBDWSKLBXT/APLKBLCFLCNL
BlendingYYYYYY
CSC (Color Space Conversion)YYYYYY
De-interlaceYYYYYY
De-noiseYYYYYY
Luma KeyYYYYYY
MirroringYYYYYY
ProcAmp (brightness,contrast,hue,saturation)YYYYYY
RotationYYYYYY
ScalingYYYYYY
SharpeningYYYYYY
STD/E (Skin Tone Detect & Enhancement)YYYYYY
TCC (Total Color Control)YYYYYY
Color fillYYYYYY
Chroma SittingNYYYYY

Known Issues and Limitations

  1. Intel(R) Media Driver for VAAPI is recommended to be built against gcc compiler v6.1 or later, which officially supported C++11.

  2. SKL: Green or other incorrect color will be observed in output frames when using YV12/I420 as input format for csc/scaling/blending/rotation, etc. on Ubuntu 16.04 stock (with kernel 4.10). The issue can be addressed with the kernel patch: WaEnableYV12BugFixInHalfSliceChicken7 commit 0b71cea29fc29bbd8e9dd9c641fee6bd75f6827

  3. CNL: HEVC encoding does not support P frame.

  4. HuC firmware is needed for AVC low power encoding bitrate control, including CBR, VBR, etc. As of now, HuC firmware support is disabled in Linux kernels by default. Please, refer to i915 kernel mode driver documentation to learn how to enable it. Mind that HuC firmware support presents in the following kernels for the specified platforms:

    • APL, KBL: starting from kernel 4.11
    • CFL: starting from kernel 4.15
  5. Restriction in implementation of vaGetImage: Source format (surface) should be same with destination format (image).

(*) Other names and brands may be claimed as property of others.