Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
Xu Guangxin edited this page Apr 10, 2019 · 20 revisions

related git repos

  1. git clone https://github.com/01org/libva.git
  2. git clone https://github.com/01org/intel-vaapi-driver.git
  3. git clone -b apache https://github.com/01org/libyami.git
  4. git clone https://github.com/01org/libyami-utils.git

Environments:

  • There is no special dependency to build libyami core library.
  • If you want to build yami decode tests with texture-video support, additional EGL/GLES2 packages are required. (sudo apt-get install libgles2-mesa-dev libegl1-mesa-dev)
  • yamidecode uses ffmpeg's avformat to demux container formats such as .mp4, .webm. you need clone git://source.ffmpeg.org/ffmpeg.git and configure libyami with --enable-avformat to support those files.

Example script for build environments

Your system maybe have pre installed libva. Build and install new one maybe make your system unstable. Following script will make sure you install library to /opt/yami. Please save them to env.sh. And "source env.sh" before you do any build things.

Many people use sudo to configure and install. It cause problem since sudo do not export the env.sh for root. Please do not use sudo, just change install directory to writable like this "sudo chmod a+w /opt/yami"

#!/bin/sh
if [ -n "$1" ]; then
    export export YAMI_ROOT_DIR=$1
else
    export YAMI_ROOT_DIR="/opt/yami"
fi

export VAAPI_PREFIX="${YAMI_ROOT_DIR}/vaapi"
export LIBYAMI_PREFIX="${YAMI_ROOT_DIR}/libyami"
ADD_PKG_CONFIG_PATH="${VAAPI_PREFIX}/lib/pkgconfig/:${LIBYAMI_PREFIX}/lib/pkgconfig/"
ADD_LD_LIBRARY_PATH="${VAAPI_PREFIX}/lib/:${LIBYAMI_PREFIX}/lib/"
ADD_PATH="${VAAPI_PREFIX}/bin/:${LIBYAMI_PREFIX}/bin/"

PLATFORM_ARCH_64=`uname -a | grep x86_64`
if [ -n "$PKG_CONFIG_PATH" ]; then
    export PKG_CONFIG_PATH="${ADD_PKG_CONFIG_PATH}:$PKG_CONFIG_PATH"
elif [ -z "$PLATFORM_ARCH_64" ]; then
    export PKG_CONFIG_PATH="${ADD_PKG_CONFIG_PATH}:/usr/lib/pkgconfig/:/usr/lib/i386-linux-gnu/pkgconfig/"
else 
    export PKG_CONFIG_PATH="${ADD_PKG_CONFIG_PATH}:/usr/lib/pkgconfig/:/usr/lib/x86_64-linux-gnu/pkgconfig/"
fi

export LD_LIBRARY_PATH="${ADD_LD_LIBRARY_PATH}:$LD_LIBRARY_PATH"

export PATH="${ADD_PATH}:$PATH"

echo "*======================current configuration============================="
echo "* VAAPI_PREFIX:               $VAAPI_PREFIX"
echo "* LIBYAMI_PREFIX:             ${LIBYAMI_PREFIX}"
echo "* LD_LIBRARY_PATH:            ${LD_LIBRARY_PATH}"
echo "* PATH:                       $PATH"
echo "*========================================================================="

echo "* libva & intel-driver:      git clean -dxf && ./autogen.sh --prefix=\$VAAPI_PREFIX && make -j8 && make install"
echo "* ffmpeg:     git clean -dxf && ./configure --prefix=\$VAAPI_PREFIX && make -j8 && make install"
echo "* libyami & utils:    git clean -dxf && ./autogen.sh --prefix=\$LIBYAMI_PREFIX && make -j8 && make install"

Build and run libyami vpp ocl blend test (for Ubuntu 14.04.3 LTS)

libyami vpp ocl depends on OpenCL extension clCreateImageFromFdINTEL, which isn't included in latest Beignet 1.1.1 (2015-10-08) release yet. So you need to build Beignet from its master branch as follows, and refer to http://www.freedesktop.org/wiki/Software/Beignet for detailed build instructions.

$ sudo apt-get install cmake pkg-config python ocl-icd-dev ocl-icd-opencl-dev libdrm-dev libxfixes-dev libxext-dev llvm-3.5-dev clang-3.5 libclang-3.5-dev libtinfo-dev libedit-dev zlib1g-dev
$ git clone git://anongit.freedesktop.org/beignet
$ cd beignet
$ mkdir build
$ cd build
$ cmake ../
$ make
$ sudo make install

Make sure /etc/OpenCL/vendors/intel-beignet-x86_64-linux-gnu.icd exist after Beignet installation. Then you can build yami vpp ocl blend test app as below. And the test needs to run where X window is enabled.

$ cd libyami
$ ./autogen.sh && ./configure --enable-oclblender && make
$ cd libyami-utils
$ ./autogen.sh && ./configure --enable-oclblender && make
$ examples/blend xxx.h264