Sorry, you need to enable JavaScript to visit this website.

Feedback

Your feedback is important to keep improving our website and offer you a more reliable experience.

Linux FFmpeg VAAPI/QSV Installation Environment

To install basic dependent packages
  1. To install basic dependencies on Ubuntu(18.04)
Basic:
#apt-get install -y cifs-utils autoconf libtool libdrm-dev yasm libghc-x11-dev libxmuu-dev libxfixes-dev libxcb-glx0-dev libgegl-dev libegl1-mesa-dev libcogl-gles2-dev
#apt-get install –y git xutils-dev libpciaccess-dev xserver-xorg-dev cmake
#apt-get install –y libv4l-dev
#apt-get install –y libasound2-dev
Rendering:
  • LibSDL: Simple DirectMedia Layer, it is using for the ffmpeg playback rendering
    #apt-get install -y libsdl2-dev
  1. To install basic dependencies on CentOS (7.5)
Basic:
#yum install -y gcc gcc-c++ autoconf automake m4 libpciaccess-devel epel-release cmake3 pciutils bison flex elfutils-libelf-devel bc openssl-devel python-make xorg-x11-server-devel libxfont2-devel expat-  devel libXrandr-devel nasm git
#ln -s /usr/bin/cmake3 /usr/bin/cmake
Rendering:
  • LibSDL: Simple DirectMedia Layer, it is using for the ffmpeg playback rendering
    #yum install -y SDL2 SDL2-devel
 
To setup downloaded source code and to build & install environment
#export ROOT_INSTALL_DIR=/opt/media/
#mkdir -p $ROOT_INSTALL_DIR
#export SRC_DIR=$HOME/media_src/
#mkdir -p $SRC_DIR
For Ubuntu(18.04)
     #export PKG_CONFIG_PATH=$ROOT_INSTALL_DIR/lib/pkgconfig/:$PKG_CONFIG_PATH
     #export LD_LIBRARY_PATH=$ROOT_INSTALL_DIR/lib:$ROOT_INSTALL_DIR/lib/mfx/:$ROOT_INSTALL_DIR/lib/xorg/:$LD_LIBRARY_PATH
     #export LDFLAGS="-L$ROOT_INSTALL_DIR/lib"
For CentOS (7.5)
    #export PKG_CONFIG_PATH=$ROOT_INSTALL_DIR/lib/pkgconfig/:$ROOT_INSTALL_DIR/lib64/pkgconfig/:$PKG_CONFIG_PATH
    #export LD_LIBRARY_PATH=$ROOT_INSTALL_DIR/lib:$ROOT_INSTALL_DIR/lib64:$LD_LIBRARY_PATH
    #export LDFLAGS="-L$ROOT_INSTALL_DIR/lib -L$ROOT_INSTALL_DIR/lib64"
#export CPPFLAGS="-I$ROOT_INSTALL_DIR/include $CPPFLAGS"
#export CFLAGS="-I$ROOT_INSTALL_DIR/include $CFLAGS"
#export CXXFLAGS="-I$ROOT_INSTALL_DIR/include $CXXFLAGS"
#export PATH=$ROOT_INSTALL_DIR/share/mfx/samples/:$ROOT_INSTALL_DIR/bin:$PATH
#export LIBVA_DRIVER_NAME=iHD

#export LIBVA_DRIVERS_PATH=$ROOT_INSTALL_DIR/lib/dri

To install FFmpeg video stack dependent packages
This section includes hwo to build and install for x264/x265, libdrm, 2D Driver(xf86-video-intel), VAAPI(libva and Intel video driver - iHD), and mediaSDK 

Linux VAAPI Video Stack Basic Packages Installation

To install FFmpeg
#git clone https://git.ffmpeg.org/ffmpeg.git $SRC_DIR/ffmpeg
#cd $SRC_DIR/ffmpeg
#./configure --prefix=$ROOT_INSTALL_DIR --enable-shared --enable-vaapi --enable-libmfx --enable-gpl --enable-libx264 --enable-libx265
#make -j8

#make install

To export related environment variables
To add the below command lines in the file of “$HOME/.bashrc” for auto configure
#ROOT_INSTALL_DIR=”/opt/media/”
#export LIBVA_DRIVER_NAME=iHD
#export LIBVA_DRIVERS_PATH=$ROOT_INSTALL_DIR/lib/dri
For Ubuntu(18.04)
    #export PKG_CONFIG_PATH=$ROOT_INSTALL_DIR/lib/pkgconfig/:$PKG_CONFIG_PATH
    #export LD_LIBRARY_PATH=$ROOT_INSTALL_DIR/lib:$ROOT_INSTALL_DIR/lib/mfx/:$ROOT_INSTALL_DIR/lib/xorg/:$LD_LIBRARY_PATH
    #export LDFLAGS="-L$ROOT_INSTALL_DIR/lib"
For CentOS (7.5)
    #export PKG_CONFIG_PATH=$ROOT_INSTALL_DIR/lib/pkgconfig/:$ROOT_INSTALL_DIR/lib64/pkgconfig/:$PKG_CONFIG_PATH
    #export LD_LIBRARY_PATH=$ROOT_INSTALL_DIR/lib:$ROOT_INSTALL_DIR/lib64:$LD_LIBRARY_PATH
    #export LDFLAGS="-L$ROOT_INSTALL_DIR/lib -L$ROOT_INSTALL_DIR/lib64"
#export PATH=$ROOT_INSTALL_DIR/share/mfx/samples/:$ROOT_INSTALL_DIR/bin:$PATH
#export CPPFLAGS="-I$ROOT_INSTALL_DIR/include $CPPFLAGS"
#export CFLAGS="-I$ROOT_INSTALL_DIR/include $CFLAGS"

#export CXXFLAGS="-I$ROOT_INSTALL_DIR/include $CXXFLAGS"