Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Brainiarc7/4f831867f8e55d35cbcb527e15f9f116 to your computer and use it in GitHub Desktop.
Save Brainiarc7/4f831867f8e55d35cbcb527e15f9f116 to your computer and use it in GitHub Desktop.
This gist will generate an Intel QSV-enabled FFmpeg build using the open source Intel Media SDK. Testbed used: Ubuntu 18.04LTS. A fallback is also provided for the intel vaapi driver where needed.

Build FFmpeg with Intel's QSV enablement on an Intel-based validation test-bed:

Build platform: Ubuntu 18.04LTS

Ensure the platform is up to date:

sudo apt update && sudo apt -y upgrade && sudo apt -y dist-upgrade

Install baseline dependencies first (inclusive of OpenCL headers+)

sudo apt-get -y install autoconf automake build-essential libass-dev libtool pkg-config texinfo zlib1g-dev libva-dev cmake mercurial libdrm-dev libvorbis-dev libogg-dev git libx11-dev libperl-dev libpciaccess-dev libpciaccess0 xorg-dev intel-gpu-tools opencl-headers libwayland-dev xutils-dev ocl-icd-* libssl-dev

Then add the Oibaf PPA, needed to install the latest development headers for libva:

sudo add-apt-repository ppa:oibaf/graphics-drivers
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade

To address linker problems down the line with Ubuntu 18.04LTS:

Referring to this: https://forum.openframeworks.cc/t/ubuntu-unable-to-compile-missing-glx-mesa/29367/2

Create the following symlink as shown:

sudo ln -s /usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0 /usr/lib/x86_64-linux-gnu/libGLX_mesa.so

Build the latest libva and all drivers from source:

Setup build environment:

Work space init:

mkdir -p ~/vaapi
mkdir -p ~/ffmpeg_build
mkdir -p ~/ffmpeg_sources
mkdir -p ~/bin

Build the dependency chain as shown, starting with installing the latest build of libdrm. This is needed to enable the cl_intel_va_api_media_sharing extension, needed when deriving OpenCL device initialization interop in FFmpeg, as illustrated later on in the documentation:

cd ~/vaapi
git clone https://anongit.freedesktop.org/git/mesa/drm.git libdrm
cd libdrm
./autogen.sh --prefix=/usr --enable-udev
time make -j$(nproc) VERBOSE=1
sudo make -j$(nproc) install
sudo ldconfig -vvvv

Then proceed with libva:

1. Libva :

Libva is an implementation for VA-API (Video Acceleration API)

VA-API is an open-source library and API specification, which provides access to graphics hardware acceleration capabilities for video processing. It consists of a main library and driver-specific acceleration backends for each supported hardware vendor. It is a prerequisite for building the VAAPI driver components below.

cd ~/vaapi
git clone https://github.com/01org/libva
cd libva
./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu
time make -j$(nproc) VERBOSE=1
sudo make -j$(nproc) install
sudo ldconfig -vvvv

2. Gmmlib:

The Intel(R) Graphics Memory Management Library provides device specific and buffer management for the Intel(R) Graphics Compute Runtime for OpenCL(TM) and the Intel(R) Media Driver for VAAPI.

The component is a prerequisite to the Intel Media driver build step below.

To build this, create a workspace directory within the vaapi sub directory and run the build:

mkdir -p ~/vaapi/workspace
cd ~/vaapi/workspace
git clone https://github.com/intel/gmmlib
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE= Release ../gmmlib
make -j$(nproc)

Then install the package:

sudo make -j$(nproc) install 

And proceed.

3. Intel Media driver:

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, released under the MIT license.

cd ~/vaapi/workspace
git clone https://github.com/intel/media-driver
cd media-driver
git submodule init
git pull
mkdir -p ~/vaapi/workspace/build_media
cd ~/vaapi/workspace/build_media

Configure the project with cmake:

cmake ../media-driver \
-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 \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=/usr/lib/x86_64-linux-gnu \
-DINSTALL_DRIVER_SYSCONF=OFF \
-DLIBVA_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri

Then build the media driver:

time make -j$(nproc) VERBOSE=1

Then install the project:

sudo make -j$(nproc) install VERBOSE=1

Add yourself to the video group:

sudo usermod -a -G video $USER

Now, export environment variables as shown below:

LIBVA_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri
LIBVA_DRIVER_NAME=iHD

Put that in /etc/environment.

And for the opensource driver (fallback, see notice below):

Export environment variables as shown below:

LIBVA_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri
LIBVA_DRIVER_NAME=i965

Put that in /etc/environment.

Notice: You should ONLY use the i965 driver for testing and validation only. For QSV-based deployments in production, ensure that iHD is the value set for the LIBVA_DRIVER_NAME variable, otherwise FFmpeg's QSV-based encoders will fail to initialize. Note that VAAPI is also supported by the iHD driver albeit to a limited feature-set, as explained in the last section.

Fallback for the Intel Opensource VAAPI driver:

  1. cmrt:

This is the C for Media Runtime GPU Kernel Manager for Intel G45 & HD Graphics family. it's a prerequisite for building the intel-hybrid-driver package on supported platforms.

cd ~/vaapi
git clone https://github.com/01org/cmrt
cd cmrt
./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu
time make -j$(nproc) VERBOSE=1
sudo make -j$(nproc) install
  1. intel-hybrid-driver:

This package provides support for WebM project VPx codecs. GPU acceleration is provided via media kernels executed on Intel GEN GPUs. The hybrid driver provides the CPU bound entropy (e.g., CPBAC) decoding and manages the GEN GPU media kernel parameters and buffers.

This package grants access to the VPX-series hybrid decode capabilities on supported hardware configurations,, namely Haswell and Skylake. Do not build this target on unsupported platforms.

Related, see this commit regarding the hybrid driver initialization failure on platforms where its' not relevant.

cd ~/vaapi
git clone https://github.com/01org/intel-hybrid-driver
cd intel-hybrid-driver
./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu
time make -j$(nproc) VERBOSE=1
sudo make -j$(nproc) install
  1. intel-vaapi-driver:

This package provides the VA-API (Video Acceleration API) user mode driver for Intel GEN Graphics family SKUs. The current video driver back-end provides a bridge to the GEN GPUs through the packaging of buffers and commands to be sent to the i915 driver for exercising both hardware and shader functionality for video decode, encode, and processing.

it also provides a wrapper to the intel-hybrid-driver when called up to handle VP8/9 hybrid decode tasks on supported hardware (when configured with the --enable-hybrid-codec option as shown below:).

cd ~/vaapi
git clone https://github.com/01org/intel-vaapi-driver
cd intel-vaapi-driver
./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --enable-hybrid-codec
time make -j$(nproc) VERBOSE=1
sudo make -j$(nproc) install

However, on Kabylake and newer, omit this as shown since its' not needed:

cd ~/vaapi
git clone https://github.com/intel/intel-vaapi-driver
cd intel-vaapi-driver
./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu 
time make -j$(nproc) VERBOSE=1
sudo make -j$(nproc) install

Proceed:

4. libva-utils:

This package provides a collection of tests for VA-API, such as vainfo, needed to validate a platform's supported features (encode, decode & postproc attributes on a per-codec basis by VAAPI entry points information).

cd ~/vaapi
git clone https://github.com/intel/libva-utils
cd libva-utils
./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu
time make -j$(nproc) VERBOSE=1
sudo make -j$(nproc) install

At this point, issue a reboot:

sudo systemctl reboot

Then on resume, proceed with the steps below, installing the Intel OpenCL platform (Neo):

Before you proceed with the iMSDK:

It is recommended that you build the Intel Neo OpenCL runtime:

Justification: This will allow for Intel's MediaSDK OpenCL inter-op back-end to be built.

Note: There's also a Personal Package Archive (PPA) for this that you can add, allowing you to skip the manual build step, as shown:

sudo add-apt-repository ppa:intel-opencl/intel-opencl
sudo apt-get update

Then install the packages:

sudo apt install intel-igc-* intel-opencl* intel-cloc intel-cmt-cat

Note that the PPA builds are a bit behind the upstream stack, and as such, these needing the latest version should use the build steps below.

Install the dependencies for the OpenCL back-end:

Build dependencies:

sudo apt-get install ccache flex bison cmake g++ git patch zlib1g-dev autoconf xutils-dev libtool pkg-config libpciaccess-dev libz-dev

Create the project structure:

mkdir -p ~/intel-compute-runtime/workspace

Within this workspace directory, fetch the sources for the required dependencies:

cd ~/intel-compute-runtime/workspace
git clone -b release_70 https://github.com/llvm-mirror/llvm llvm_source
git clone -b release_70 https://github.com/llvm-mirror/clang llvm_source/tools/clang
git clone -b ocl-open-70 https://github.com/intel/opencl-clang llvm_source/projects/opencl-clang
git clone -b llvm_release_70 https://github.com/KhronosGroup/SPIRV-LLVM-Translator llvm_source/projects/llvm-spirv
git clone https://github.com/intel/llvm-patches llvm_patches
git clone https://github.com/intel/intel-graphics-compiler igc
git clone https://github.com/intel/compute-runtime neo

Create a build directory for the Intel Graphics Compiler under the workspace:

mkdir -p ~/intel-compute-runtime/workspace/build_igc

Then build:

cd ~/intel-compute-runtime/workspace/build_igc
cmake ../igc/IGC
time make -j1 VERBOSE=1

Recommended: Generate Debian archives for installation:

time make -j1 package VERBOSE=1

Install:

sudo dpkg -i *.deb

(Ran in the build directory) will suffice.

To install directly without relying on the package manager:

On whatever Linux distribution you're on, you can also run:

sudo make -j1 install

If you prefer to skip the generated binary artifacts by cpack. This may solve package installation and dependency issues that some of you are encountering.

Then proceed.

Next, build and install the compute runtime project. Start by creating a separate build directory for it:

mkdir -p ~/intel-compute-runtime/workspace/build_icr
cd ~/intel-compute-runtime/workspace/build_icr
cmake -DBUILD_TYPE=Release -DCMAKE_BUILD_TYPE=Release -DSKIP_UNIT_TESTS=1 ../neo
time make -j$(nproc) package VERBOSE=1

Then install the deb archives:

sudo dpkg -i *.deb 

From the build directory.

To install directly without relying on the package manager:

On whatever Linux distribution you're on, you can also run:

sudo make -j1 install

If you prefer to skip the generated binary artifacts by cpack. This may solve package installation and dependency issues that some of you are encountering.

Testing:

Use clinfo and confirm that the ICD is detected.

Optionally, run Luxmark and confirm that Intel Neo's OpenCL platform is detected and usable.

Be aware that Luxmark, among others, require freeglut, which you can install by running:

sudo apt install freeglut3*

4. Build Intel's MSDK:

This package provides an API to access hardware-accelerated video decode, encode and filtering on Intel® platforms with integrated graphics. It is supported on platforms that the intel-media-driver is targeted for.

For supported features per generation, see this.

Build steps:

(a). Fetch the sources into the working directory ~/vaapi:

cd ~/vaapi
git clone https://github.com/Intel-Media-SDK/MediaSDK msdk
cd msdk
git submodule init
git pull

(b). Configure the build:

mkdir -p ~/vaapi/build_msdk
cd ~/vaapi/build_msdk
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_WAYLAND=ON -DENABLE_X11_DRI3=ON -DENABLE_OPENCL=ON  ../msdk
time make -j$(nproc) VERBOSE=1
sudo make install -j$(nproc) VERBOSE=1

CMake will automatically detect the platform you're on and enable the platform-specific hooks needed for a working build.

Create a library config file for the iMSDK:

sudo nano /etc/ld.so.conf.d/imsdk.conf

Content:

/opt/intel/mediasdk/lib
/opt/intel/mediasdk/plugins

Then run:

sudo ldconfig -vvvv

To proceed.

When done, issue a reboot:

 sudo systemctl reboot

Build a usable FFmpeg binary with the iMSDK:

Include extra components as needed:

(a). Build and deploy nasm: Nasm is an assembler for x86 optimizations used by x264 and FFmpeg. Highly recommended or your resulting build may be very slow.

Note that we've now switched away from Yasm to nasm, as this is the current assembler that x265,x264, among others, are adopting.

cd ~/ffmpeg_sources
wget wget http://www.nasm.us/pub/nasm/releasebuilds/2.14rc0/nasm-2.14rc0.tar.gz
tar xzvf nasm-2.14rc0.tar.gz
cd nasm-2.14rc0
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" 
make -j$(nproc) VERBOSE=1
make -j$(nproc) install
make -j$(nproc) distclean

(b). Build and deploy libx264 statically: This library provides a H.264 video encoder. See the H.264 Encoding Guide for more information and usage examples. This requires ffmpeg to be configured with --enable-gpl --enable-libx264.

cd ~/ffmpeg_sources
git clone http://git.videolan.org/git/x264.git -b stable
cd x264/
PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --enable-static --enable-shared
PATH="$HOME/bin:$PATH" make -j$(nproc) VERBOSE=1
make -j$(nproc) install VERBOSE=1
make -j$(nproc) distclean

(c ). Build and configure libx265: This library provides a H.265/HEVC video encoder. See the H.265 Encoding Guide for more information and usage examples.

cd ~/ffmpeg_sources
hg clone https://bitbucket.org/multicoreware/x265
cd ~/ffmpeg_sources/x265/build/linux
PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source
make -j$(nproc) VERBOSE=1
make -j$(nproc) install VERBOSE=1
make -j$(nproc) clean VERBOSE=1

(d). Build and deploy the libfdk-aac library: This provides an AAC audio encoder. See the AAC Audio Encoding Guide for more information and usage examples. This requires ffmpeg to be configured with --enable-libfdk-aac (and --enable-nonfree if you also included --enable-gpl).

cd ~/ffmpeg_sources
wget -O fdk-aac.tar.gz https://github.com/mstorsjo/fdk-aac/tarball/master
tar xzvf fdk-aac.tar.gz
cd mstorsjo-fdk-aac*
autoreconf -fiv
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make -j$(nproc)
make -j$(nproc) install
make -j$(nproc) distclean

(e). Build and configure libvpx:

cd ~/ffmpeg_sources
git clone https://github.com/webmproject/libvpx
cd libvpx
./configure --prefix="$HOME/ffmpeg_build" --enable-runtime-cpu-detect --enable-vp9 --enable-vp8 \
--enable-postproc --enable-vp9-postproc --enable-multi-res-encoding --enable-webm-io --enable-better-hw-compatibility --enable-vp9-highbitdepth --enable-onthefly-bitpacking --enable-realtime-only --cpu=native --as=nasm 
time make -j$(nproc)
time make -j$(nproc) install
time make clean -j$(nproc)
time make distclean

(f). Build LibVorbis:

cd ~/ffmpeg_sources
wget -c -v http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.6.tar.xz
tar -xvf libvorbis-1.3.6.tar.xz
cd libvorbis-1.3.6
./configure --enable-static --prefix="$HOME/ffmpeg_build"
time make -j$(nproc)
time make -j$(nproc) install
time make clean -j$(nproc)
time make distclean

(g). Build FFmpeg (with OpenCL enabled):

Notes on API support:

The hardware can be accessed through a number of different APIs:

i.libmfx on Linux:

This is a library from Intel which can be installed as part of the Intel Media SDK, and supports a subset of encode and decode cases.

ii.vaapi on Linux:

A fully opensource stack, dependent on libva and an appropriate VAAPI driver, that can be configured at runtime via the LIBVA-related environment variables (as shown above).

In our use case, that is the backend that we will be using throughout this validation with this FFmpeg build:

cd ~/ffmpeg_sources
git clone https://github.com/FFmpeg/FFmpeg -b master
cd FFmpeg
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig:/opt/intel/mediasdk/lib/pkgconfig" ./configure \
  --pkg-config-flags="--static" \
  --prefix="$HOME/bin" \
  --bindir="$HOME/bin" \
  --extra-cflags="-I$HOME/bin/include" \
  --extra-ldflags="-L$HOME/bin/lib" \
  --extra-cflags="-I/opt/intel/mediasdk/include" \
  --extra-ldflags="-L/opt/intel/mediasdk/lib" \
  --extra-ldflags="-L/opt/intel/mediasdk/plugins" \
  --enable-libmfx \
  --enable-vaapi \
  --enable-opencl \
  --disable-debug \
  --enable-libvorbis \
  --enable-libvpx \
  --enable-libdrm \
  --enable-gpl \
  --cpu=native \
  --enable-libfdk-aac \
  --enable-libx264 \
  --enable-libx265 \
  --enable-openssl \
  --extra-libs=-lpthread \
  --enable-nonfree 
PATH="$HOME/bin:$PATH" make -j$(nproc) 
make -j$(nproc) install 
make -j$(nproc) distclean 
hash -r

Note: To get debug builds, add the --enable-debug=3 configuration flag and omit the distclean step and you'll find the ffmpeg_g binary under the sources subdirectory.

We only want the debug builds when an issue crops up and a gdb trace may be required for debugging purposes. Otherwise, leave this omitted for production environments.

Sample snippets to test the new encoders:

Confirm that the VAAPI & QSV-based encoders have been built successfully:

(a). VAAPI:

ffmpeg  -hide_banner -encoders | grep vaapi 

 V..... h264_vaapi           H.264/AVC (VAAPI) (codec h264)
 V..... hevc_vaapi           H.265/HEVC (VAAPI) (codec hevc)
 V..... mjpeg_vaapi          MJPEG (VAAPI) (codec mjpeg)
 V..... mpeg2_vaapi          MPEG-2 (VAAPI) (codec mpeg2video)
 V..... vp8_vaapi            VP8 (VAAPI) (codec vp8)
 V..... vp9_vaapi            VP9 (VAAPI) (codec vp9)


(b). QSV:

 V..... h264_qsv             H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (Intel Quick Sync Video acceleration) (codec h264)
 V..... hevc_qsv             HEVC (Intel Quick Sync Video acceleration) (codec hevc)
 V..... mjpeg_qsv            MJPEG (Intel Quick Sync Video acceleration) (codec mjpeg)
 V..... mpeg2_qsv            MPEG-2 video (Intel Quick Sync Video acceleration) (codec mpeg2video)

See the help documentation for each encoder in question:

ffmpeg -hide_banner -h encoder='encoder name'

Test the encoders;

Using GNU parallel, we will encode some mp4 files (4k H.264 test samples, 40 minutes each, AAC 6-channel audio) on the ~/src path on the system to VP8 and HEVC respectively using the examples below. Note that I've tuned the encoders to suit my use-cases, and re-scaling to 1080p is enabled. Adjust as necessary (and compensate as needed if ~/bin is not on the system path).

To VP8, launching 10 encode jobs simultaneously:

parallel -j 10 --verbose 'ffmpeg -loglevel debug -threads 4 -hwaccel vaapi -i "{}"  -vaapi_device /dev/dri/renderD129 -c:v vp8_vaapi -loop_filter_level:v 63 -loop_filter_sharpness:v 15 -b:v 4500k -maxrate:v 7500k -vf 'format=nv12,hwupload,scale_vaapi=w=1920:h=1080' -c:a libvorbis -b:a 384k -ac 6 -f webm "{.}.webm"' ::: $(find . -type f -name '*.mp4')

To HEVC with GNU Parallel:

To HEVC Main Profile, launching 10 encode jobs simultaneously:

parallel -j 4 --verbose 'ffmpeg -loglevel debug -threads 4 -hwaccel vaapi -i "{}"  -vaapi_device /dev/dri/renderD129 -c:v hevc_vaapi -qp:v 19 -b:v 2100k -maxrate:v 3500k -vf 'format=nv12,hwupload,scale_vaapi=w=1920:h=1080' -c:a libvorbis -b:a 384k -ac 6 -f matroska "{.}.mkv"' ::: $(find . -type f -name '*.mp4')

FFmpeg QSV encoder usage notes:

I provide an example below that demonstrates the use of a complex filter chain with the QSV encoders in place for livestreaming purposes. Adapt as per your needs.

Complex Filter chain usage for variant stream encoding with Intel's QSV encoders:

Take the example snippet below, which takes the safest (and not necessarily the fastest route), utilizing a hybrid encoder approach (partial hwaccel with significant processor load):

ffmpeg -re -stream_loop -1 -threads n -loglevel debug -filter_complex_threads n \
-init_hw_device qsv=qsv:hw -hwaccel qsv -filter_hw_device qsv \
-i 'udp://$stream_url:$port?fifo_size=9000000' \
-filter_complex "[0:v]hwupload=extra_hw_frames=10,vpp_qsv=deinterlace=2,split=6[s0][s1][s2][s3][s4][s5]; \
[s0]hwupload=extra_hw_frames=10,scale_qsv=1920:1080:format=nv12[v0]; \
[s1]hwupload=extra_hw_frames=10,scale_qsv=1280:720:format=nv12[v1];
[s2]hwupload=extra_hw_frames=10,scale_qsv=960:540:format=nv12[v2];
[s3]hwupload=extra_hw_frames=10,scale_qsv=842:480:format=nv12[v3];
[s4]hwupload=extra_hw_frames=10,scale_qsv=480:360:format=nv12[v4];
[s5]hwupload=extra_hw_frames=10,scale_qsv=426:240:format=nv12[v5]" \
-b:v:0 2250k -c:v h264_qsv -a53cc 1 -rdo 1 -pic_timing_sei 1 -recovery_point_sei 1 -profile high -aud 1 \
-b:v:1 1750k -c:v h264_qsv -a53cc 1 -rdo 1 -pic_timing_sei 1 -recovery_point_sei 1 -profile high -aud 1 \
-b:v:2 1000k -c:v h264_qsv -a53cc 1 -rdo 1 -pic_timing_sei 1 -recovery_point_sei 1 -profile high -aud 1 \
-b:v:3 875k -c:v h264_qsv -a53cc 1 -rdo 1 -pic_timing_sei 1 -recovery_point_sei 1 -profile high -aud 1 \
-b:v:4 750k -c:v h264_qsv -a53cc 1 -rdo 1 -pic_timing_sei 1 -recovery_point_sei 1 -profile high -aud 1 \
-b:v:5 640k -c:v h264_qsv -a53cc 1 -rdo 1 -pic_timing_sei 1 -recovery_point_sei 1 -profile high -aud 1 \
-c:a aac -b:a 128k -ar 48000 -ac 2 \
-flags -global_header -f tee  \
-map "[v0]" -map "[v1]" -map "[v2]" -map "[v3]" -map "[v4]" -map "[v5]" -map 0:a:0 -map 0:a:1 \
"[select=\'v:0,a\':f=mpegts]udp:$stream_url_out:$port_out| \
 [select=\'v:0,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:0,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:1,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:1,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:1,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:2,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:2,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:2,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:3,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:3,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:3,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:4,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:4,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:4,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:5,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:5,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:5,a\':f=mpegts]udp://$stream_url_out:$port_out"

Template breakdown:

The ffmpeg snippet assumes the following:

  1. The UDP ingest stream specifier has one video stream and two separate audio streams, as shown in the explicit mapping above: -map "[v0]" -map "[v1]" -map "[v2]" -map "[v3]" -map "[v4]" -map "[v5]" -map 0:a:0 -map 0:a:1

The mapping is needed because the tee muxer (-f tee) makes no assumptions about the capabilities of the underlying muxer launched beneath the fifo process.

  1. We encode audio only once. Consider audio as a blocking encoder and minimize unnecessary encoder duplication to save on CPU cycles.

  2. We split the incoming streams into six, and in so doing:

(a). Allocate a single thread to each filter complex chain. Thus the value n set for -filter_complex_threads should match the number of split=n value.

(b). Allocate the total thread count for FFmpeg to the value specified above. This ensures that each encoder is fed only through a single thread, the optimal value for hardware-accelerated encoding.

The following notes about thread allocation in FFmpeg applies doubly so:

More encoder threads beyond a certain threshold increases latency and will have a higher encoding memory footprint. Quality degradation is more prominent with higher thread counts in constant bitrate modes and near-constant bitrate mode called VBV (video buffer verifier), due to increased encode delay. Keyframes need more data then other frame types to avoid pulsing poor quality keyframes.

Zero-delay or sliced thread mode (on supported encoders) has no delay, but this option farther worsens multi-threads quality in supported encoders.

It's therefore wise to limit thread counts on encodes where latency matters, as the perceived encoder throughput increase offsets any advantages it may bring in the long term.

  1. Through the tee muxer, we then allocate each encoded stream variant to an output, through the select statement in the bracketed clauses above. This allows us to generate exponentially more elementary streams than there are encoders.

  2. On the tuning options passed to the h264_qsv encoder:

(a). The hwupload filter must be appended with the extra_hw_frames=10 option, because the QSV encoder expects a fixed initial pool size.
Conceptually, this should happen automatically, but the problem is that the mfx plugins lack sufficient negotiation with the encoder to know how big the pool should be - if it's feeding into a scaler (such as the complex scale filter chain above), then probably 2 or 3 frames are sufficient, but if it's feeding into an encoder with look-ahead enabled then you might need over 100. As such, it's currently under user control and must be applied to ensure proper encoder initialization.

Without this option, the encoder will fail as shown below:

[AVHWFramesContext @ 0x3e26ec0] QSV requires a fixed frame pool size
[AVHWFramesContext @ 0x3e26ec0] Error creating an internal frame pool
[Parsed_hwupload_1 @ 0x3e26880] Failed to configure output pad on Parsed_hwupload_1
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
[AVIOContext @ 0x3a68f80] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 0x3a6cd40] Statistics: 1022463 bytes read, 0 seeks
Conversion failed!

(b). When initializing the encoder, the hardware device node for libmfx must be initialized as shown:

-init_hw_device qsv=qsv:MFX_IMPL_hw_any -hwaccel qsv -filter_hw_device qsv

That ensures that the proper hardware accelerator node (qsv) is initialized with the proper device context (-init_hw_device qsv=qsv:hw) with device nodes for a hardware accelerator implementation being inherited (-hwaccel qsv) with an appropriate filter device (-filter_hw_device qsv) are initialized for resource allocation by the hwupload filter, the vpp_qsv post-processor (needed for advanced deinterlacing) and the scale_vpp filter (needed for texture format conversion to nv12, otherwise the encoder will fail).

If hardware scaling is undesired, the filter chain can be modified from:

[sn]hwupload=extra_hw_frames=10,scale_qsv=W:H:format=nv12[vn]

To:

[sn]hwupload=extra_hw_frames=10,scale_qsv=format=nv12[vn]

Where n is the stream specifier id inherited from the complex filter chain. Note that the texture conversion is mandatory, and cannot be skipped.

The other arguments passed to the encoder are optimal for smooth streaming, enabling automatic detection and use of closed captions, an advanced rate distortion algorithm and sensible bitrates and profile limits per encoder variant.

Special notes concerning performance:

If you're after a full hardware-accelerated transcode pipeline (use with caution as it may not work with all input formats), see the snippet below:

ffmpeg -re -stream_loop -1 -threads n -loglevel debug -filter_complex_threads n \
-c:v h264_qsv -hwaccel qsv \
-i 'udp://$stream_url:$port?fifo_size=9000000' \
-filter_complex "[0:v]vpp_qsv=deinterlace=2,split=6[s0][s1][s2][s3][s4][s5]; \
[s0]scale_qsv=1920:1080:format=nv12[v0]; \
[s1]scale_qsv=1280:720:format=nv12[v1];
[s2]scale_qsv=960:540:format=nv12[v2];
[s3]scale_qsv=842:480:format=nv12[v3];
[s4]scale_qsv=480:360:format=nv12[v4];
[s5]scale_qsv=426:240:format=nv12[v5]" \
-b:v:0 2250k -c:v h264_qsv -a53cc 1 -rdo 1 -pic_timing_sei 1 -recovery_point_sei 1 -profile high -aud 1 \
-b:v:1 1750k -c:v h264_qsv -a53cc 1 -rdo 1 -pic_timing_sei 1 -recovery_point_sei 1 -profile high -aud 1 \
-b:v:2 1000k -c:v h264_qsv -a53cc 1 -rdo 1 -pic_timing_sei 1 -recovery_point_sei 1 -profile high -aud 1 \
-b:v:3 875k -c:v h264_qsv -a53cc 1 -rdo 1 -pic_timing_sei 1 -recovery_point_sei 1 -profile high -aud 1 \
-b:v:4 750k -c:v h264_qsv -a53cc 1 -rdo 1 -pic_timing_sei 1 -recovery_point_sei 1 -profile high -aud 1 \
-b:v:5 640k -c:v h264_qsv -a53cc 1 -rdo 1 -pic_timing_sei 1 -recovery_point_sei 1 -profile high -aud 1 \
-c:a aac -b:a 128k -ar 48000 -ac 2 \
-flags -global_header -f tee  \
-map "[v0]" -map "[v1]" -map "[v2]" -map "[v3]" -map "[v4]" -map "[v5]" -map 0:a:0 -map 0:a:1 \
"[select=\'v:0,a\':f=mpegts]udp:$stream_url_out:$port_out| \
 [select=\'v:0,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:0,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:1,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:1,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:1,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:2,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:2,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:2,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:3,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:3,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:3,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:4,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:4,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:4,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:5,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:5,a\':f=mpegts]udp://$stream_url_out:$port_out| \
 [select=\'v:5,a\':f=mpegts]udp://$stream_url_out:$port_out"

So, what has changed here? For one:

(a). We have selected an appropriate QSV-based decoder based on the video codec type in the ingest feed (h264), assigned as -c:v h264_qsv and the -hwaccel qsv as the hwaccel before declaring the input (-i). If the ingest feed is MPEG-2, select the MPEG decoder (-c:v mpeg2_qsv) instead.

(b). We have dropped the manual H/W init (-init_hw_device qsv=qsv:MFX_IMPL_hw_any -hwaccel qsv -filter_hw_device qsv) and the hwupload video filter.

  1. The open source iMSDK has a frame encoder limit of 1000 for the HEVC-based encoder, and as such, the HEVC encoder components should only be used for evaluation purposes. These that require these functions should consult the proprietary licensed SDK. To specify the frame limit in ffmpeg, use the -vframes n option, where n is an integer.

  2. The iHD libva driver also provides similar VAAPI functionality as the opensource i965 driver, with a few discrepancies:

(a). It does not offer encode entry points for VP8 and VP9 codecs (yet). (b). As mentioned above, HEVC encoding is for evaluation purposes only and will limit the encode to a mere 1000 frames.

See the VAAPI features enabled with this iHD driver:

vainfo 
libva info: VA-API version 1.2.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_2
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.2 (libva 2.2.1.pre1)
vainfo: Driver version: Intel iHD driver - 2.0.0
vainfo: Supported profile and entrypoints
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileNone                   :	VAEntrypointStats
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointFEI
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointFEI
      VAProfileH264High               :	VAEntrypointEncSliceLP
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointFEI
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointFEI
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileHEVCMain10             :	VAEntrypointEncSlice
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD

Note: OpenCL enablement in both libx264 and FFmpeg are dependent on the following conditions:

(a). The flag --disable-opencl is removed from libx264's configuration.

(b). The flag --enable-opencl is present in FFmpeg's configure options.

(c ). The prerequisite packages for OpenCL development are present:

With OpenCL, the installable client drivers (ICDs) are normally issued with the accelerator's device drivers, namely:

1.The NVIDIA CUDA toolkit (and the device driver) for NVIDIA GPUs.
2. AMD's RoCM for GCN-class AMD hardware.
3. Intel's beignet and the newer Neo compute runtime, as on OUR platform.

The purpose of the installable client driver model is to allow multiple OpenCL platforms to coexist on the same platform. That way, multiple OpenCL accelerators, be they discrete GPUs paired with a combination of FPGAs and integrated GPUs can all coexist.

However, for linkage purposes, you'll require the ocl-icd package (which we installed earlier), which can be installed by:

sudo apt install ocl-icd-* 

Why ocl-icd? Simple: Whereas other ICDs may permit you to link against them directly, it is discouraged so as to limit the risk of unexpected runtime behavior. Assume ocl-icd to be the gold link target if your goal is to be platform-neutral as possible.

OpenCL in FFmpeg:

OpenCL's enablement in FFmpeg comes in two ways:

(a):. Some encoders, such as libx264, if built with OpenCL enablement, can utilize these capabilities for accelerated lookahead functions. The performance impact for this enablement will vary with the GPU on the platform, and with older GPUs, may slow down the encoder. Lower power platforms such as specific AMD APUs and their SoCs may see modest performance improvements at best, but on modern, high performance GPUs, your mileage may vary. Expect no miracles. The reason OpenCL lookahead is available for this library in particular is that the lookahead algorithms for OpenCL are easily parallelized.

For instance, you can combine the -hwaccel auto option which allows you to select the hardware-based accelerated decoding to use for the encode session with libx264. You can add this parameter with "auto" before input (if your x264 is compiled with OpenCL support you can try to add -x264opts param), for example:

ffmpeg -hwaccel auto -i input -vcodec libx264 -x264opts opencl output

(b):. FFmpeg, in particular, can utilize OpenCL with some filters, namely program_opencl and opencl_src as documented in the filters documentation, among others.

See the sample command below:

ffmpeg -hide_banner -v verbose -init_hw_device 
opencl=ocl:1.0 -filter_hw_device ocl -i 
"cheeks.mkv" -an -map_metadata -1 -sws_flags 
lanczos+accurate_rnd+full_chroma_int+full_chroma_inp -filter_complex 
"[0:v]yadif=0:0:0,hwupload,unsharp_opencl=lx=3:ly=3:la=0.5:cx=3:cy=3:ca=0.5,hwdownload,setdar=dar=16/9" 
 -r 25 -c:v h264_nvenc -preset:v llhq -bf 2 -g 50 -refs 3 -rc:v 
vbr_hq -rc-lookahead:v 32 -coder:v cabac -movflags 
+faststart -profile:v high -level 4.1 -pixel_format yuv420p -y 
"crunchy_cheeks.mp4"

List OpenCL platform devices:*

ffmpeg -hide_banner -v verbose -init_hw_device list
ffmpeg -hide_banner -v verbose -init_hw_device opencl
ffmpeg -hide_banner -v verbose -init_hw_device opencl:1.0 

For the filter, see:

ffmpeg -hide_banner -v verbose -h filter=unsharp_opencl 

Example:

On the test-bed:

ffmpeg -hide_banner -v verbose -init_hw_device list
Supported hardware device types:
vaapi
qsv
drm
opencl

And based on these platforms:

(a). QSV:

ffmpeg -hide_banner -v verbose -init_hw_device qsv
[AVHWDeviceContext @ 0x559f67501440] Opened VA display via X11 display :1.
[AVHWDeviceContext @ 0x559f67501440] libva: VA-API version 1.2.0
[AVHWDeviceContext @ 0x559f67501440] libva: va_getDriverName() returns 0
[AVHWDeviceContext @ 0x559f67501440] libva: User requested driver 'iHD'
[AVHWDeviceContext @ 0x559f67501440] libva: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x559f67501440] libva: Found init function __vaDriverInit_1_2
[AVHWDeviceContext @ 0x559f67501440] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x559f67501440] Initialised VAAPI connection: version 1.2
[AVHWDeviceContext @ 0x559f67501440] Unknown driver "Intel iHD driver - 2.0.0", assuming standard behaviour.
[AVHWDeviceContext @ 0x559f67501040] Initialize MFX session: API version is 1.27, implementation version is 1.27
[AVHWDeviceContext @ 0x559f67501040] MFX compile/runtime API: 1.27/1.27
Hyper fast Audio and Video encoder

(b). VAAPI:

ffmpeg -hide_banner -v verbose -init_hw_device vaapi
[AVHWDeviceContext @ 0x56362b64d040] Opened VA display via X11 display :1.
[AVHWDeviceContext @ 0x56362b64d040] libva: VA-API version 1.2.0
[AVHWDeviceContext @ 0x56362b64d040] libva: va_getDriverName() returns 0
[AVHWDeviceContext @ 0x56362b64d040] libva: User requested driver 'iHD'
[AVHWDeviceContext @ 0x56362b64d040] libva: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x56362b64d040] libva: Found init function __vaDriverInit_1_2
[AVHWDeviceContext @ 0x56362b64d040] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x56362b64d040] Initialised VAAPI connection: version 1.2
[AVHWDeviceContext @ 0x56362b64d040] Unknown driver "Intel iHD driver - 2.0.0", assuming standard behaviour.

(c). OpenCL:

ffmpeg -hide_banner -v verbose -init_hw_device opencl

[AVHWDeviceContext @ 0x55dee05a2040] 0.0: NVIDIA CUDA / GeForce GTX 1070 with Max-Q Design
[AVHWDeviceContext @ 0x55dee05a2040] 1.0: Intel(R) OpenCL HD Graphics / Intel(R) Gen9 HD Graphics NEO
[AVHWDeviceContext @ 0x55dee05a2040] More than one matching device found.
Device creation failed: -19.
Failed to set value 'opencl' for option 'init_hw_device': No such device
Error parsing global options: No such device

Now, you'll notice a platform init error for OpenCL, and that is because we did not pick up a specific device. When done properly, for both devices, this is the output you should get:

i. First OpenCL device:

ffmpeg -hide_banner -v verbose -init_hw_device opencl:1.0

[AVHWDeviceContext @ 0x562f64b66040] 1.0: Intel(R) OpenCL HD Graphics / Intel(R) Gen9 HD Graphics NEO
Hyper fast Audio and Video encoder

ii. Second OpenCL device:

ffmpeg -hide_banner -v verbose -init_hw_device opencl:0.1

ffmpeg -hide_banner -v verbose -init_hw_device opencl:0.0
[AVHWDeviceContext @ 0x55e7524fb040] 0.0: NVIDIA CUDA / GeForce GTX 1070 with Max-Q Design

Take note of the syntax used. On a platform with more than one OpenCL platform, the device ordinal must be selected from the OpenCL platform its' on, followed by the device index number.

Using the example above, you can see that this device has two OpenCL platforms, the Intel Neo stack and the NVIDIA CUDA stack. These platforms are opencl:1 and opencl:0 respectively. The devices are opencl:1:1 and opencl:0:0 respectively, where the first device ordinal is always zero (0).

An OpenCL-based tonemap filter example:

You can use an OpenCL-based tone map filters, allowing for HDR(HDR10/HLG) to SDR conversion with tone-mapping, with the example shown below:

ffmpeg -init_hw_device vaapi=va:/dev/dri/renderD128 -init_hw_device \
opencl=ocl@va -hwaccel vaapi -hwaccel_device va -hwaccel_output_format \
vaapi -i INPUT -filter_hw_device ocl -filter_complex \
'[0:v]hwmap,tonemap_opencl=t=bt2020:tonemap=linear:format=p010[x1]; \
[x1]hwmap=derive_device=vaapi:reverse=1' -c:v hevc_vaapi -profile 2 OUTPUT
@catalan63
Copy link

catalan63 commented Jul 23, 2019

Hey men, i fint the answer to my clue, Haswell is not supported by media-driver, only by VAAPI, it says in the list of supported platforms.

Supported Platforms
BDW (Broadwell)

SKL (Skylake)

BXT (Broxton) / APL (Apollo Lake)

KBL (Kaby Lake)

CFL (Coffee Lake)

WHL (Whiskey Lake)

CML (Comet Lake)

ICL (Ice Lake)

Thanks for your help.

@andreasunterhuber
Copy link

@Brainiarc7 Thanks for your detailed description. Do you have a comparison about ffmpeg vpp_qsv=deinterlace=2 (advanced) and vpp_qsv=deinterlace=1 (blob) mode? I get pretty bad results - seems like both are not deinterlace at all. You have an example? Thanks

@Brainiarc7
Copy link
Author

@andreasunterhuber show me your full FFmpeg snippet, thanks.

@andreasunterhuber
Copy link

@Brainiarc7 thanks. I used ffmpeg -hwaccel qsv -init_hw_device qsv=hw -filter_hw_device hw -v info -i input.ts -vf 'format=nv12,hwupload=extra_hw_frames=64,format=qsv,vpp_qsv=framerate=25:deinterlace=2' -c:a libfdk_aac -b:a 192k -ac 2 -c:v h264_qsv -global_quality 19 -qmin 15 -qmax 32 -maxrate 4500K -minrate 1900K -mbbrc 1 -y ffmpegtest-QVBR-qsv_vpp_advanced.mp4 - and it seems to work now. Till now I used it in another environment... so the problem is not based on ffmpeg.
By the way: you have any info about the visual quality results of the two deinterlacing methods? I did not found anything useful on the web or on Intel website (MFX_DEINTERLACING_ADVANCED or MFX_DEINTERLACING_BOB).

@Brainiarc7
Copy link
Author

Hmm, use this snippet instead, what you're doing is losing performance on transcode:

ffmpeg -v info -init_hw_device qsv=hw -filter_hw_device hw -hwaccel qsv -hwaccel_output_format qsv \
-threads 4 -reinit_filter 1  \
-i input.ts -vf 'format=qsv|nv12,hwupload=extra_hw_frames=64,vpp_qsv=framerate=25:deinterlace=2' \
-c:a libfdk_aac -b:a 192k -ac 2 -c:v h264_qsv -global_quality 19 -qmin 15 -qmax 32 -maxrate 4500K -minrate 1900K -mbbrc 1 \
-y ffmpegtest-QVBR-qsv_vpp_advanced.mp4

Report back on that and see the difference in throughput.
Concerning the two deinterlacing methods, I wouldn't be too concerned about it as both methods implement spatial interlacing checks.
What I'd recommend to use for deinterlacing is the deinterlace_qsv filter, should you need more fine-grained control over that.
For usage options, see:

ffmpeg -h filter=deinterlace_qsv

Thanks,

Brainiarc7.

@mj43
Copy link

mj43 commented Sep 22, 2019

Does this build support the atom z8350 (cherry trail) processor? I believe I have followed the build correctly but get a
libva: /usr/x86_64-linux-gnu/dri/iHD_drv_video.so init failed

when I try the following (input is a web cam).
ffmpeg -y -init_hw_device qsv=hw -filter_hw_device hw -s:v 1280x720 -framerate 30 -i /dev/video2 -vf hwupload=extra_hw_frames=64,format=qsv -t 10 -c:v h264_qsv -b:v 5M output.mp4

I tried the build on a N4200 Apollo Lake and that worked fine.

@Brainiarc7
Copy link
Author

Cherry Trail's integrated GPU is based on Broadwell (BDW), and that should be supported by the Media driver package.
vainfo's warnings (such as what you observed above) can be ignored, it should not affect FFmpeg's functionality as far as QuickSync is concerned.
If that bothers you, you may run vainfo as shown for the correct output:

vainfo --display drm --device /dev/dri/renderD128

@mj43
Copy link

mj43 commented Sep 23, 2019

Thanks, before reading your reply I loaded Ubuntu 19.04 as that allows Intel Media SDK to be added via apt (so I shouldn't get that wrong).
Similar message from vainfo.

mark@mark-box:~/Desktop$ vainfo libva info: VA-API version 1.4.0 libva info: va_getDriverName() returns 0 libva info: User requested driver 'iHD' libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_4 libva error: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed libva info: va_openDriver() returns 1 vaInitialize failed with error code 1 (operation failed),exit

@Brainiarc7
Copy link
Author

Brainiarc7 commented Sep 23, 2019 via email

@mj43
Copy link

mj43 commented Sep 24, 2019

reloaded Ubuntu 18.04 and rebuilt as per this gist. Ran vainfo as indicated same result?

mark@mark-box:~$ vainfo --display drm --device /dev/dri/renderD128 libva info: VA-API version 1.6.0 libva info: va_getDriverName() returns 0 libva info: User requested driver 'iHD' libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_6 libva error: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed libva info: va_openDriver() returns 1 vaInitialize failed with error code 1 (operation failed),exit

@Brainiarc7
Copy link
Author

Brainiarc7 commented Sep 24, 2019 via email

@mj43
Copy link

mj43 commented Sep 24, 2019

Output from ldconfig -wvvvvv
mark@mark-box:~$ ldconfig -vvvvvv /sbin/ldconfig.real: Can't stat /opt/intel/mediasdk/plugins: No such file or directory /sbin/ldconfig.real: Can't stat /usr/local/lib/x86_64-linux-gnu: No such file or directory /sbin/ldconfig.real: Path /lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
/usr/lib/x86_64-linux-gnu/libfakeroot:
libfakeroot-0.so -> libfakeroot-tcp.so
/opt/intel/mediasdk/lib:
libmfx.so.1 -> libmfx.so.1.30
libmfxhw64.so.1 -> libmfxhw64.so.1.30
/usr/local/lib:
libigdgmm.so.11 -> libigdgmm.so.11.0.0
/lib/x86_64-linux-gnu:
libnss_myhostname.so.2 -> libnss_myhostname.so.2
libnss_mdns_minimal.so.2 -> libnss_mdns_minimal.so.2
libnss_mdns6_minimal.so.2 -> libnss_mdns6_minimal.so.2
libnss_mdns6.so.2 -> libnss_mdns6.so.2
libthread_db.so.1 -> libthread_db-1.0.so
libgcc_s.so.1 -> libgcc_s.so.1
libnss_mdns.so.2 -> libnss_mdns.so.2
libnsl.so.1 -> libnsl-2.27.so
libbrlapi.so.0.6 -> libbrlapi.so.0.6.6
libattr.so.1 -> libattr.so.1.1.0
libz.so.1 -> libz.so.1.2.11
libply-splash-core.so.4 -> libply-splash-core.so.4.0.0
libnss_systemd.so.2 -> libnss_systemd.so.2
libacl.so.1 -> libacl.so.1.1.0
libSegFault.so -> libSegFault.so
libbz2.so.1.0 -> libbz2.so.1.0.4
libexpat.so.1 -> libexpat.so.1.6.7
libcap-ng.so.0 -> libcap-ng.so.0.0.0
libsystemd.so.0 -> libsystemd.so.0.21.0
libpcre.so.3 -> libpcre.so.3.13.3
libcryptsetup.so.12 -> libcryptsetup.so.12.2.0
libpthread.so.0 -> libpthread-2.27.so
libreadline.so.7 -> libreadline.so.7.0
libjson-c.so.3 -> libjson-c.so.3.0.1
libuuid.so.1 -> libuuid.so.1.3.0
libcap.so.2 -> libcap.so.2.25
liblzo2.so.2 -> liblzo2.so.2.0.0
libatm.so.1 -> libatm.so.1.0.0
libe2p.so.2 -> libe2p.so.2.3
libfuse.so.2 -> libfuse.so.2.9.7
libanl.so.1 -> libanl-2.27.so
libpcprofile.so -> libpcprofile.so
libcrypt.so.1 -> libcrypt-2.27.so
libss.so.2 -> libss.so.2.0
libbsd.so.0 -> libbsd.so.0.8.7
libiw.so.30 -> libiw.so.30
libnss_compat.so.2 -> libnss_compat-2.27.so
libwrap.so.0 -> libwrap.so.0.7.6
librt.so.1 -> librt-2.27.so
libhistory.so.7 -> libhistory.so.7.0
libntfs-3g.so.88 -> libntfs-3g.so.88.0.0
libsepol.so.1 -> libsepol.so.1
libply-splash-graphics.so.4 -> libply-splash-graphics.so.4.0.0
libpam_misc.so.0 -> libpam_misc.so.0.82.0
libpamc.so.0 -> libpamc.so.0.82.1
libfdisk.so.1 -> libfdisk.so.1.1.0
libisc-export.so.169 -> libisc-export.so.169.0.1
libdevmapper.so.1.02.1 -> libdevmapper.so.1.02.1
libidn.so.11 -> libidn.so.11.6.16
libcidn.so.1 -> libcidn-2.27.so
libblkid.so.1 -> libblkid.so.1.1.0
/sbin/ldconfig.real: /lib/x86_64-linux-gnu/ld-2.27.so is the dynamic linker, ignoring

ld-linux-x86-64.so.2 -> ld-2.27.so
libgpg-error.so.0 -> libgpg-error.so.0.22.0
libply-boot-client.so.4 -> libply-boot-client.so.4.0.0
libm.so.6 -> libm-2.27.so
libdl.so.2 -> libdl-2.27.so
libresolv.so.2 -> libresolv-2.27.so
libusb-1.0.so.0 -> libusb-1.0.so.0.1.0
libmvec.so.1 -> libmvec-2.27.so
libmount.so.1 -> libmount.so.1.1.0
libseccomp.so.2 -> libseccomp.so.2.4.1
libkeyutils.so.1 -> libkeyutils.so.1.5
libkmod.so.2 -> libkmod.so.2.3.2
libBrokenLocale.so.1 -> libBrokenLocale-2.27.so
libsmartcols.so.1 -> libsmartcols.so.1.1.0
libnl-3.so.200 -> libnl-3.so.200.24.0
libncursesw.so.5 -> libncursesw.so.5.9
libnss_mdns4.so.2 -> libnss_mdns4.so.2
libpci.so.3 -> libpci.so.3.5.2
libnss_files.so.2 -> libnss_files-2.27.so
libcom_err.so.2 -> libcom_err.so.2.1
libnss_dns.so.2 -> libnss_dns-2.27.so
libulockmgr.so.1 -> libulockmgr.so.1.0.1
libtinfo.so.5 -> libtinfo.so.5.9
libnl-genl-3.so.200 -> libnl-genl-3.so.200.24.0
libnih.so.1 -> libnih.so.1.0.0
libutil.so.1 -> libutil-2.27.so
libply.so.4 -> libply.so.4.0.0
libext2fs.so.2 -> libext2fs.so.2.4
libnss_nisplus.so.2 -> libnss_nisplus-2.27.so
liblzma.so.5 -> liblzma.so.5.2.2
libdns-export.so.1100 -> libdns-export.so.1100.1.1
libnewt.so.0.52 -> libnewt.so.0.52.20
libaudit.so.1 -> libaudit.so.1.0.0
libapparmor.so.1 -> libapparmor.so.1.4.2
libnss_mdns4_minimal.so.2 -> libnss_mdns4_minimal.so.2
libslang.so.2 -> libslang.so.2.3.1
libpam.so.0 -> libpam.so.0.83.1
libmnl.so.0 -> libmnl.so.0.2.0
libmemusage.so -> libmemusage.so
libprocps.so.6 -> libprocps.so.6.0.0
libudev.so.1 -> libudev.so.1.6.9
libparted.so.2 -> libparted.so.2.0.1
libdbus-1.so.3 -> libdbus-1.so.3.19.4
libncurses.so.5 -> libncurses.so.5.9
libnss_hesiod.so.2 -> libnss_hesiod-2.27.so
libatasmart.so.4 -> libatasmart.so.4.0.5
libparted-fs-resize.so.0 -> libparted-fs-resize.so.0.0.1
libselinux.so.1 -> libselinux.so.1
libnss_nis.so.2 -> libnss_nis-2.27.so
libgcrypt.so.20 -> libgcrypt.so.20.2.1
libc.so.6 -> libc-2.27.so

/usr/lib/x86_64-linux-gnu:
libwoff2common.so.1.0.2 -> libwoff2common.so.1.0.2
libgnome-bluetooth.so.13 -> libgnome-bluetooth.so.13.0.1
libapt-inst.so.2.0 -> libapt-inst.so.2.0.0
libpsl.so.5 -> libpsl.so.5.2.0
libgstrtp-1.0.so.0 -> libgstrtp-1.0.so.0.1405.0
libperl.so.5.26 -> libperl.so.5.26.1
libcups.so.2 -> libcups.so.2
libplds4.so -> libplds4.so
libsamba-passdb.so.0 -> libsamba-passdb.so.0.27.0
libcrypto.so.1.0.0 -> libcrypto.so.1.0.0
libicudata.so.60 -> libicudata.so.60.2
libsamba-credentials.so.0 -> libsamba-credentials.so.0.0.1
libbind9.so.160 -> libbind9.so.160.0.6
libigdfcl.so.1 -> libigdfcl.so.1.0.11
libbabeltrace.so.1 -> libbabeltrace.so.1.0.0
libsane.so.1 -> libsane.so.1.0.27
libicuio.so.60 -> libicuio.so.60.2
librsvg-2.so.2 -> librsvg-2.so.2.40.20
libX11-xcb.so.1 -> libX11-xcb.so.1.0.0
libdazzle-1.0.so.0 -> libdazzle-1.0.so.0
libssh_threads.so.4 -> libssh_threads.so.4.5.0
libwacom.so.2 -> libwacom.so.2.6.1
libFS.so.6 -> libFS.so.6.0.0
liblz4.so.1 -> liblz4.so.1.7.1
libigdgmm.so.9 -> libigdgmm.so.9.0.3
libwebrtc_audio_processing.so.1 -> libwebrtc_audio_processing.so.1.0.0
libbd_crypto.so.2 -> libbd_crypto.so.2.0.0
libwoff2dec.so.1.0.2 -> libwoff2dec.so.1.0.2
libxcb-xfixes.so.0 -> libxcb-xfixes.so.0.0.0
libnss3.so -> libnss3.so
libclucene-contribs-lib.so.1 -> libclucene-contribs-lib.so.2.3.3.4
libcdda_interface.so.0 -> libcdda_interface.so.0.10.2
libnetfilter_conntrack.so.3 -> libnetfilter_conntrack.so.3.6.0
libaspell.so.15 -> libaspell.so.15.2.0
libcc1.so.0 -> libcc1.so.0.0.0
libsamplerate.so.0 -> libsamplerate.so.0.1.8
libsemanage.so.1 -> libsemanage.so.1
libformw.so.5 -> libformw.so.5.9
libXvMC.so.1 -> libXvMC.so.1.0.0
libdatrie.so.1 -> libdatrie.so.1.3.3
libavahi-common.so.3 -> libavahi-common.so.3.5.3
libexslt.so.0 -> libexslt.so.0.8.17
libaa.so.1 -> libaa.so.1.0.4
libecal-1.2.so.19 -> libecal-1.2.so.19.0.0
libsnapd-glib.so.1 -> libsnapd-glib.so.1.0.0
libvorbisfile.so.3 -> libvorbisfile.so.3.3.7
libMagickWand-6.Q16.so.3 -> libMagickWand-6.Q16.so.3.0.0
libijs-0.35.so -> libijs-0.35.so
libXrandr.so.2 -> libXrandr.so.2.2.0
libgmime-3.0.so.0 -> libgmime-3.0.so.0.200.0
libinproctrace.so -> libinproctrace.so
libelf.so.1 -> libelf-0.170.so
libXpm.so.4 -> libXpm.so.4.11.0
libgoa-backend-1.0.so.1 -> libgoa-backend-1.0.so.1.0.0
libnm.so.0 -> libnm.so.0.1.0
libical.so.3 -> libical.so.3.0.1
libGLX.so.0 -> libGLX.so.0.0.0
libICE.so.6 -> libICE.so.6.3.0
libOpenCL.so.1 -> libOpenCL.so.1.0.0
libarchive.so.13 -> libarchive.so.13.2.2
libkrb5.so.26 -> libkrb5.so.26.0.0
libcurl.so.4 -> libcurl.so.4.5.0
libnssutil3.so -> libnssutil3.so
libsodium.so.23 -> libsodium.so.23.1.0
libmtp.so.9 -> libmtp.so.9.3.0
libwavpack.so.1 -> libwavpack.so.1.2.0
libexempi.so.3 -> libexempi.so.3.4.5
libjbig.so.0 -> libjbig.so.0
libsnmp.so.30 -> libsnmp.so.30.0.3
libgdbm_compat.so.4 -> libgdbm_compat.so.4.0.0
libopcodes-2.30-system.so -> libopcodes-2.30-system.so
libform.so.5 -> libform.so.5.9
libpeas-1.0.so.0 -> libpeas-1.0.so.0.2200.0
libmpg123.so.0 -> libmpg123.so.0.44.8
libfftw3f.so.3 -> libfftw3f.so.3.5.7
libpipeline.so.1 -> libpipeline.so.1.5.0
libgnome-autoar-0.so.0 -> libgnome-autoar-0.so.0.0.0
libdrm_radeon.so.1 -> libdrm_radeon.so.1.0.1
libwhoopsie-preferences.so.0 -> libwhoopsie-preferences.so.0.0.0
libgdm.so.1 -> libgdm.so.1.0.0
libcupsimage.so.2 -> libcupsimage.so.2
libfl.so.2 -> libfl.so.2.0.0
libiga64.so.1 -> libiga64.so.1.0.11
libbabeltrace-ctf-text.so.1 -> libbabeltrace-ctf-text.so.1.0.0
libboost_system.so.1.65.1 -> libboost_system.so.1.65.1
libicu-le-hb.so.0 -> libicu-le-hb.so.0.0.0
libXxf86dga.so.1 -> libXxf86dga.so.1.0.0
libusbmuxd.so.4 -> libusbmuxd.so.4.0.0
libxcb-randr.so.0 -> libxcb-randr.so.0.1.0
libxcb-render.so.0 -> libxcb-render.so.0.0.0
libva-wayland.so.2 -> libva-wayland.so.2.600.0
libsoup-2.4.so.1 -> libsoup-2.4.so.1.8.0
libe-book-0.1.so.1 -> libe-book-0.1.so.1.0.3
libplc4.so -> libplc4.so
libiec61883.so.0 -> libiec61883.so.0.1.1
libcolord.so.2 -> libcolord.so.2.0.5
libltdl.so.7 -> libltdl.so.7.3.1
libsgutils2.so.2 -> libsgutils2.so.2.0.0
libv4l2rds.so.0 -> libv4l2rds.so.0.0.0
libdcerpc-server.so.0 -> libdcerpc-server.so.0.0.1
libspectre.so.1 -> libspectre.so.1.1.8
libpcaudio.so.0 -> libpcaudio.so.0.0.0
libfftw3f_threads.so.3 -> libfftw3f_threads.so.3.5.7
libnetapi.so.0 -> libnetapi.so.0
libwebpdemux.so.2 -> libwebpdemux.so.2.0.3
libharfbuzz.so.0 -> libharfbuzz.so.0.10702.0
libproxy.so.1 -> libproxy.so.1.0.0
libnetsnmphelpers.so.30 -> libnetsnmphelpers.so.30.0.3
libhpdiscovery.so.0 -> libhpdiscovery.so.0.0.1
libpolkit-agent-1.so.0 -> libpolkit-agent-1.so.0.0.0
liblouisutdml.so.8 -> liblouisutdml.so.8.0.0
libgailutil-3.so.0 -> libgailutil-3.so.0.0.0
libunwind-x86_64.so.8 -> libunwind-x86_64.so.8.0.1
libsonic.so.0 -> libsonic.so.0.2.0
libmtdev.so.1 -> libmtdev.so.1.0.0
libXrender.so.1 -> libXrender.so.1.3.0
libgdk_pixbuf-2.0.so.0 -> libgdk_pixbuf-2.0.so.0.3611.0
libnetsnmptrapd.so.30 -> libnetsnmptrapd.so.30.0.3
libfreerdp-client2.so.2 -> libfreerdp-client2.so.2.0.0
libmpfr.so.6 -> libmpfr.so.6.0.1
libhcrypto.so.4 -> libhcrypto.so.4.1.0
libodfgen-0.1.so.1 -> libodfgen-0.1.so.1.0.6
libsecret-1.so.0 -> libsecret-1.so.0.0.0
libGLESv1_CM.so.1 -> libGLESv1_CM.so.1.0.0
libXfixes.so.3 -> libXfixes.so.3.1.0
libdbusmenu-gtk3.so.4 -> libdbusmenu-gtk3.so.4.0.12
libxcb-dri2.so.0 -> libxcb-dri2.so.0.0.0
libwebpmux.so.3 -> libwebpmux.so.3.0.1
libfftw3_omp.so.3 -> libfftw3_omp.so.3.5.7
libdmx.so.1 -> libdmx.so.1.0.0
liblua5.3-c++.so.0 -> liblua5.3-c++.so.0.0.0
libgobject-2.0.so.0 -> libgobject-2.0.so.0.5600.4
libyaml-0.so.2 -> libyaml-0.so.2.0.5
libphonenumber.so.7 -> libphonenumber.so.7.0
libtag.so.1 -> libtag.so.1.17.0
libwnck-3.so.0 -> libwnck-3.so.0.3.0
libnspr4.so -> libnspr4.so
liborc-0.4.so.0 -> liborc-0.4.so.0.28.0
libpulse-mainloop-glib.so.0 -> libpulse-mainloop-glib.so.0.0.5
libtiff.so.5 -> libtiff.so.5.3.0
libdb-5.3.so -> libdb-5.3.so
libgccpp.so.1 -> libgccpp.so.1.0.3
libspeechd.so.2 -> libspeechd.so.2.6.0
libmenuw.so.5 -> libmenuw.so.5.9
libnautilus-extension.so.1 -> libnautilus-extension.so.1.4.0
libssh.so.4 -> libssh.so.4.5.0
libespeak-ng.so.1 -> libespeak-ng.so.1.1.49
libitm.so.1 -> libitm.so.1.0.0
libclutter-gst-3.0.so.0 -> libclutter-gst-3.0.so.0.26.0
libapt-private.so.0.0 -> libapt-private.so.0.0.0
libshout.so.3 -> libshout.so.3.2.0
libLLVM-8.so.1 -> libLLVM-8.0.0.so.1
libssl.so.1.0.0 -> libssl.so.1.0.0
libGeoIP.so.1 -> libGeoIP.so.1.6.12
libcogl.so.20 -> libcogl.so.20.4.2
libunity.so.9 -> libunity.so.9.0.2
libedataserverui-1.2.so.2 -> libedataserverui-1.2.so.2.0.0
libssl.so.1.1 -> libssl.so.1.1
libglapi.so.0 -> libglapi.so.0.0.0
libgnome-menu-3.so.0 -> libgnome-menu-3.so.0.0.1
libwmf-0.2.so.7 -> libwmf-0.2.so.7.1.0
libopus.so.0 -> libopus.so.0.5.2
libnpth.so.0 -> libnpth.so.0.1.1
libestr.so.0 -> libestr.so.0.0.0
libthai.so.0 -> libthai.so.0.3.0
libudisks2.so.0 -> libudisks2.so.0.0.0
libGL.so.1 -> libGL.so.1.0.0
libaudio.so.2 -> libaudio.so.2.4
libjansson.so.4 -> libjansson.so.4.11.0
libgd.so.3 -> libgd.so.3.0.5
libhpipp.so.0 -> libhpipp.so.0.0.1
libunity-extras.so.9 -> libunity-extras.so.9.0.2
libgc.so.1 -> libgc.so.1.0.3
libogg.so.0 -> libogg.so.0.8.2
libmpc.so.3 -> libmpc.so.3.1.0
libxshmfence.so.1 -> libxshmfence.so.1.0.0
libzstd.so.1 -> libzstd.so.1.3.3
libIlmImf-2_2.so.22 -> libIlmImf-2_2.so.22.0.0
libunwind-ptrace.so.0 -> libunwind-ptrace.so.0.0.0
libcupsppdc.so.1 -> libcupsppdc.so.1
libjacknet.so.0 -> libjacknet.so.0.1.0
libidn2.so.0 -> libidn2.so.0.3.3
libxmlsec1-nss.so.1 -> libxmlsec1-nss.so.1.2.25
libjavascriptcoregtk-4.0.so.18 -> libjavascriptcoregtk-4.0.so.18.13.7
libtevent-util.so.0 -> libtevent-util.so.0.0.1
libbabeltrace-dummy.so.1 -> libbabeltrace-dummy.so.1.0.0
libgomp.so.1 -> libgomp.so.1.0.0
libjack.so.0 -> libjack.so.0.1.0
libgstsdp-1.0.so.0 -> libgstsdp-1.0.so.0.1405.0
libdrm.so.2 -> libdrm.so.2.4.0
libbabeltrace-ctf.so.1 -> libbabeltrace-ctf.so.1.0.0
libgdk_pixbuf_xlib-2.0.so.0 -> libgdk_pixbuf_xlib-2.0.so.0.3611.0
libcilkrts.so.5 -> libcilkrts.so.5.0.0
libv4l1.so.0 -> libv4l1.so.0.0.0
libgcr-base-3.so.1 -> libgcr-base-3.so.1.0.0
libGLESv2.so.2 -> libGLESv2.so.2.0.0
libisccfg.so.160 -> libisccfg.so.160.1.2
libgtop-2.0.so.11 -> libgtop-2.0.so.11.0.0
libxcb-present.so.0 -> libxcb-present.so.0.0.0
libgstreamer-1.0.so.0 -> libgstreamer-1.0.so.0.1405.0
libpcreposix.so.3 -> libpcreposix.so.3.13.3
libaccountsservice.so.0 -> libaccountsservice.so.0.0.0
libvolume_key.so.1 -> libvolume_key.so.1.2.2
libboost_thread.so.1.65.1 -> libboost_thread.so.1.65.1
libmutter-2.so.0 -> libmutter-2.so.0.0.0
libgcab-1.0.so.0 -> libgcab-1.0.so.0.0.0
libao.so.4 -> libao.so.4.1.1
libpolkit-gobject-1.so.0 -> libpolkit-gobject-1.so.0.0.0
libnma.so.0 -> libnma.so.0.0.0
libpcre16.so.3 -> libpcre16.so.3.13.3
liblber-2.4.so.2 -> liblber-2.4.so.2.10.8
libdrm_intel.so.1 -> libdrm_intel.so.1.0.0
libpackagekit-glib2.so.18 -> libpackagekit-glib2.so.18.1.3
libdcerpc-samr.so.0 -> libdcerpc-samr.so.0.0.1
libva-glx.so.2 -> libva-glx.so.2.100.0
libboost_date_time.so.1.65.1 -> libboost_date_time.so.1.65.1
libgweather-3.so.15 -> libgweather-3.so.15.0.0
libglib-2.0.so.0 -> libglib-2.0.so.0.5600.4
librhash.so.0 -> librhash.so.0
libEGL_mesa.so.0 -> libEGL_mesa.so.0.0.0
libieee1284.so.3 -> libieee1284.so.3.2.2
libcdio_cdda.so.2 -> libcdio_cdda.so.2.0.0
liborc-test-0.4.so.0 -> liborc-test-0.4.so.0.28.0
libmpx.so.2 -> libmpx.so.2.0.1
libharfbuzz-gobject.so.0 -> libharfbuzz-gobject.so.0.10702.0
libgs.so.9 -> libgs.so.9.26
libexif.so.12 -> libexif.so.12.3.3
libcaca.so.0 -> libcaca.so.0.99.19
libfontconfig.so.1 -> libfontconfig.so.1.10.1
libdv.so.4 -> libdv.so.4.0.3
libxmlsec1.so.1 -> libxmlsec1.so.1.2.25
libmagic.so.1 -> libmagic.so.1.0.0
libheimbase.so.1 -> libheimbase.so.1.0.0
libdrm_amdgpu.so.1 -> libdrm_amdgpu.so.1.0.0
libXtst.so.6 -> libXtst.so.6.1.0
libk5crypto.so.3 -> libk5crypto.so.3.1
libtdb.so.1 -> libtdb.so.1.3.15
libgrilo-0.3.so.0 -> libgrilo-0.3.so.0.1.3
libsndfile.so.1 -> libsndfile.so.1.0.28
libavc1394.so.0 -> libavc1394.so.0.3.0
libgudev-1.0.so.0 -> libgudev-1.0.so.0.2.0
libXcomposite.so.1 -> libXcomposite.so.1.0.0
libtheoraenc.so.1 -> libtheoraenc.so.1.1.2
libva-x11.so.2 -> libva-x11.so.2.600.0
libX11.so.6 -> libX11.so.6.3.0
libedit.so.2 -> libedit.so.2.0.56
libisc-pkcs11.so.169 -> libisc-pkcs11.so.169.0.1
libsamba-errors.so.1 -> libsamba-errors.so.1
libtheora.so.0 -> libtheora.so.0.3.10
libdbusmenu-glib.so.4 -> libdbusmenu-glib.so.4.0.12
libcrypto.so.1.1 -> libcrypto.so.1.1
libpcrecpp.so.0 -> libpcrecpp.so.0.0.1
libapt-pkg.so.5.0 -> libapt-pkg.so.5.0.2
libiptc.so.0 -> libiptc.so.0.0.0
libigfxcmrt.so.7 -> libigfxcmrt.so.7.2.0
libavahi-core.so.7 -> libavahi-core.so.7.0.2
libwayland-egl.so.1 -> libwayland-egl.so.1.0.0
libvorbis.so.0 -> libvorbis.so.0.4.8
libgnomekbdui.so.8 -> libgnomekbdui.so.8.0.0
libigc.so.1 -> libigc.so.1.0.11
libharfbuzz-icu.so.0 -> libharfbuzz-icu.so.0.10702.0
libgom-1.0.so.0 -> libgom-1.0.so.0.1.0
libpcre32.so.3 -> libpcre32.so.3.13.3
libgpgme.so.11 -> libgpgme.so.11.19.0
libicalvcal.so.3 -> libicalvcal.so.3.0.1
libgtk-3.so.0 -> libgtk-3.so.0.2200.30
libgdk-x11-2.0.so.0 -> libgdk-x11-2.0.so.0.2400.32
libyelp.so.0 -> libyelp.so.0.0.0
libzeitgeist-2.0.so.0 -> libzeitgeist-2.0.so.0.0.0
libunwind.so.8 -> libunwind.so.8.0.1
libcmrt.so.1 -> libcmrt.so.1.1001.0
libgstvideo-1.0.so.0 -> libgstvideo-1.0.so.0.1405.0
libunwind-coredump.so.0 -> libunwind-coredump.so.0.0.0
libsmbldap.so.2 -> libsmbldap.so.2
libdaemon.so.0 -> libdaemon.so.0.5.0
libavahi-client.so.3 -> libavahi-client.so.3.2.9
libevent-2.1.so.6 -> libevent-2.1.so.6.0.2
libpeas-gtk-1.0.so.0 -> libpeas-gtk-1.0.so.0.2200.0
libgck-1.so.0 -> libgck-1.so.0.0.0
libpoppler.so.73 -> libpoppler.so.73.0.0
libicalss_cxx.so.3 -> libicalss_cxx.so.3.0.1
libmp3lame.so.0 -> libmp3lame.so.0.0.0
libcdr-0.1.so.1 -> libcdr-0.1.so.1.0.4
libcairo.so.2 -> libcairo.so.2.11510.0
libnuma.so.1 -> libnuma.so.1.0.0
liblouis.so.14 -> liblouis.so.14.1.2
libgphoto2.so.6 -> libgphoto2.so.6.0.0
libldap_r-2.4.so.2 -> libldap_r-2.4.so.2.10.8
libisccc.so.160 -> libisccc.so.160.0.2
libblockdev.so.2 -> libblockdev.so.2.0.0
libcroco-0.6.so.3 -> libcroco-0.6.so.3.0.1
libjsoncpp.so.1 -> libjsoncpp.so.1.7.4
libbfd-2.30-system.so -> libbfd-2.30-system.so
libefiboot.so.1 -> libefiboot.so.1.34
libbd_utils.so.2 -> libbd_utils.so.2.1.0
libndp.so.0 -> libndp.so.0.1.0
libunistring.so.2 -> libunistring.so.2.1.0
libass.so.9 -> libass.so.9.0.2
libsamba-util.so.0 -> libsamba-util.so.0.0.1
libv4l2.so.0 -> libv4l2.so.0.0.0
libdbus-glib-1.so.2 -> libdbus-glib-1.so.2.3.4
libwayland-cursor.so.0 -> libwayland-cursor.so.0.0.0
libvte-2.91.so.0 -> libvte-2.91.so.0.5200.2
libmm-glib.so.0 -> libmm-glib.so.0.4.0
libcrack.so.2 -> libcrack.so.2.9.0
libwhoopsie.so.0 -> libwhoopsie.so.0.0
libXext.so.6 -> libXext.so.6.4.0
libquadmath.so.0 -> libquadmath.so.0.0.0
libxklavier.so.16 -> libxklavier.so.16.4.0
libpolkit-backend-1.so.0 -> libpolkit-backend-1.so.0.0.0
libcolamd.so.2 -> libcolamd.so.2.9.6
libappstream.so.4 -> libappstream.so.0.12.0
libpanel.so.5 -> libpanel.so.5.9
libsmbclient.so.0 -> libsmbclient.so.0.2.3
libhpip.so.0 -> libhpip.so.0.0.1
libbrotlienc.so.1 -> libbrotlienc.so.1.0.4
libgstnet-1.0.so.0 -> libgstnet-1.0.so.0.1405.0
libexpatw.so.1 -> libexpatw.so.1.6.7
libjbig2dec.so.0 -> libjbig2dec.so.0.0.0
libgstallocators-1.0.so.0 -> libgstallocators-1.0.so.0.1405.0
libjpeg.so.8 -> libjpeg.so.8.1.2
libXxf86vm.so.1 -> libXxf86vm.so.1.0.0
libgmodule-2.0.so.0 -> libgmodule-2.0.so.0.5600.4
libdw.so.1 -> libdw-0.170.so
libwoff2enc.so.1.0.2 -> libwoff2enc.so.1.0.2
libxcb-shm.so.0 -> libxcb-shm.so.0.0.0
librest-0.7.so.0 -> librest-0.7.so.0.0.0
libpython3.6m.so.1.0 -> libpython3.6m.so.1.0
libgnome-desktop-3.so.17 -> libgnome-desktop-3.so.17.0.0
libgdbm.so.5 -> libgdbm.so.5.0.0
libxkbcommon-x11.so.0 -> libxkbcommon-x11.so.0.0.0
libgdata.so.22 -> libgdata.so.22.3.0
libplist.so.3 -> libplist.so.3.1.0
libgstaudio-1.0.so.0 -> libgstaudio-1.0.so.0.1405.0
libgutenprint.so.2 -> libgutenprint.so.2.6.0
libpoppler-glib.so.8 -> libpoppler-glib.so.8.9.0
libXaw.so.7 -> libXaw7.so.7.0.0
libSM.so.6 -> libSM.so.6.0.1
liblcms2.so.2 -> liblcms2.so.2.0.8
libtasn1.so.6 -> libtasn1.so.6.5.5
libcogl-path.so.20 -> libcogl-path.so.20.4.2
libmspub-0.1.so.1 -> libmspub-0.1.so.1.0.4
libXt.so.6 -> libXt.so.6.0.0
libqpdf.so.21 -> libqpdf.so.21.0.2
libwebp.so.6 -> libwebp.so.6.0.2
libmbim-glib.so.4 -> libmbim-glib.so.4.4.0
libnghttp2.so.14 -> libnghttp2.so.14.15.2
libmpdec.so.2 -> libmpdec.so.2.4.2
libspeex.so.1 -> libspeex.so.1.5.0
libraw1394.so.11 -> libraw1394.so.11.1.0
libLLVM-6.0.so.1 -> libLLVM-6.0.so.1
libfreerdp2.so.2 -> libfreerdp2.so.2.0.0
libheimntlm.so.0 -> libheimntlm.so.0.1.0
libfftw3f_omp.so.3 -> libfftw3f_omp.so.3.5.7
librevenge-stream-0.0.so.0 -> librevenge-stream-0.0.so.0.0.4
libgtksourceview-3.0.so.1 -> libgtksourceview-3.0.so.1.8.0
libhx509.so.5 -> libhx509.so.5.0.0
libedata-cal-1.2.so.28 -> libedata-cal-1.2.so.28.0.0
liblqr-1.so.0 -> liblqr-1.so.0.3.2
libtic.so.5 -> libtic.so.5.9
libsmime3.so -> libsmime3.so
liblua5.3.so.0 -> liblua5.3.so.0.0.0
libXss.so.1 -> libXss.so.1.0.0
libgxps.so.2 -> libgxps.so.2.2.2
libbd_part_err.so.2 -> libbd_part_err.so.2.0.0
libpytalloc-util.so.2 -> libpytalloc-util.so.2.1.10
libXmuu.so.1 -> libXmuu.so.1.0.0
libgettextlib-0.19.8.1.so -> libgettextlib.so
libhpmud.so.0 -> libhpmud.so.0.0.6
libgstcontroller-1.0.so.0 -> libgstcontroller-1.0.so.0.1405.0
libcheese.so.8 -> libcheese.so.8.0.10
libLLVM-9.so.1 -> libLLVM-9.so.1
libevdocument3.so.4 -> libevdocument3.so.4.0.0
libXvMCW.so.1 -> libXvMCW.so.1.0.0
libbd_swap.so.2 -> libbd_swap.so.2.0.0
libkpathsea.so.6 -> libkpathsea.so.6.2.3
libgrlpls-0.3.so.0 -> libgrlpls-0.3.so.0.0.0
libnfnetlink.so.0 -> libnfnetlink.so.0.2.0
libedata-book-1.2.so.25 -> libedata-book-1.2.so.25.0.0
libbd_fs.so.2 -> libbd_fs.so.2.0.0
libwayland-client.so.0 -> libwayland-client.so.0.3.0
libcmis-0.5.so.5 -> libcmis-0.5.so.5.0.0
libva-drm.so.2 -> libva-drm.so.2.600.0
libpulse-simple.so.0 -> libpulse-simple.so.0.1.1
libsqlite3.so.0 -> libsqlite3.so.0.8.6
libOpenGL.so.0 -> libOpenGL.so.0.0.0
libcupsmime.so.1 -> libcupsmime.so.1
libassuan.so.0 -> libassuan.so.0.8.1
libfontembed.so.1 -> libfontembed.so.1.0.0
libpangoft2-1.0.so.0 -> libpangoft2-1.0.so.0.4000.14
libpaper.so.1 -> libpaper.so.1.1.2
libhyphen.so.0 -> libhyphen.so.0.3.0
libpulse.so.0 -> libpulse.so.0.20.2
libinput.so.10 -> libinput.so.10.13.0
libgstcheck-1.0.so.0 -> libgstcheck-1.0.so.0.1405.0
libgexiv2.so.2 -> libgexiv2.so.2.0.0
libatk-bridge-2.0.so.0 -> libatk-bridge-2.0.so.0.0.0
libvpx.so.5 -> libvpx.so.5.0.0
libmenu.so.5 -> libmenu.so.5.9
libdrm_nouveau.so.2 -> libdrm_nouveau.so.2.0.0
libwinpr2.so.2 -> libwinpr2.so.2.0.0
libdcerpc-binding.so.0 -> libdcerpc-binding.so.0.0.1
libsuitesparseconfig.so.5 -> libsuitesparseconfig.so.5.1.2
libfreetype.so.6 -> libfreetype.so.6.15.0
libHalf.so.12 -> libHalf.so.12.0.0
libstemmer.so.0d -> libstemmer.so.0d.0.0
libteamdctl.so.0 -> libteamdctl.so.0.1.5
libfftw3.so.3 -> libfftw3.so.3.5.7
libsbc.so.1 -> libsbc.so.1.2.1
libicutest.so.60 -> libicutest.so.60.2
libtalloc.so.2 -> libtalloc.so.2.1.10
libubsan.so.0 -> libubsan.so.0.0.0
libgpm.so.2 -> libgpm.so.2
libgstphotography-1.0.so.0 -> libgstphotography-1.0.so.0.1405.0
libdee-1.0.so.4 -> libdee-1.0.so.4.2.1
libqmi-glib.so.5 -> libqmi-glib.so.5.4.0
libbrotlidec.so.1 -> libbrotlidec.so.1.0.4
libgcr-ui-3.so.1 -> libgcr-ui-3.so.1.0.0
libXi.so.6 -> libXi.so.6.1.0
libndr-nbt.so.0 -> libndr-nbt.so.0.0.1
libfastjson.so.4 -> libfastjson.so.4.2.0
libcmis-c-0.5.so.5 -> libcmis-c-0.5.so.5.0.0
libgraphene-1.0.so.0 -> libgraphene-1.0.so.0.800.0
libebook-1.2.so.19 -> libebook-1.2.so.19.1.3
liblangtag.so.1 -> liblangtag.so.1.4.1
libhogweed.so.4 -> libhogweed.so.4.4
libicuuc.so.60 -> libicuuc.so.60.2
libwayland-server.so.0 -> libwayland-server.so.0.1.0
libepubgen-0.1.so.1 -> libepubgen-0.1.so.1.0.0
libsysmetrics.so.1 -> libsysmetrics.so.1
libgnomekbd.so.8 -> libgnomekbd.so.8.0.0
libXdmcp.so.6 -> libXdmcp.so.6.0.0
libatk-1.0.so.0 -> libatk-1.0.so.0.22810.1
libxcb-glx.so.0 -> libxcb-glx.so.0.0.0
libIlmThread-2_2.so.12 -> libIlmThread-2_2.so.12.0.0
libbabeltrace-ctf-metadata.so.1 -> libbabeltrace-ctf-metadata.so.1.0.0
libXft.so.2 -> libXft.so.2.3.2
libgstrtsp-1.0.so.0 -> libgstrtsp-1.0.so.0.1405.0
libsensors.so.4 -> libsensors.so.4.4.0
libical_cxx.so.3 -> libical_cxx.so.3.0.1
libImath-2_2.so.12 -> libImath-2_2.so.12.0.0
librevenge-generators-0.0.so.0 -> librevenge-generators-0.0.so.0.0.4
libenchant.so.1 -> libenchant.so.1.6.0
libgphoto2_port.so.12 -> libgphoto2_port.so.12.0.0
libupower-glib.so.3 -> libupower-glib.so.3.0.1
libnetsnmpagent.so.30 -> libnetsnmpagent.so.30.0.3
libgee-0.8.so.2 -> libgee-0.8.so.2.6.1
libdcerpc.so.0 -> libdcerpc.so.0.0.1
libgio-2.0.so.0 -> libgio-2.0.so.0.5600.4
libFLAC.so.8 -> libFLAC.so.8.3.0
libargon2.so.0 -> libargon2.so.0
libclutter-gtk-1.0.so.0 -> libclutter-gtk-1.0.so.0.800.4
libgstbasecamerabinsrc-1.0.so.0 -> libgstbasecamerabinsrc-1.0.so.0.1405.0
libIex-2_2.so.12 -> libIex-2_2.so.12.0.0
libclutter-1.0.so.0 -> libclutter-1.0.so.0.2600.2
libfwup.so.1 -> libfwup.so.1.12
libxcb-icccm.so.4 -> libxcb-icccm.so.4.0.0
libgspell-1.so.1 -> libgspell-1.so.1.3.0
libjackserver.so.0 -> libjackserver.so.0.1.0
libgailutil.so.18 -> libgailutil.so.18.0.1
libicalss.so.3 -> libicalss.so.3.0.1
libndr.so.0 -> libndr.so.0.1.0
libkrb5support.so.0 -> libkrb5support.so.0.1
libffi.so.6 -> libffi.so.6.0.4
libasn1.so.8 -> libasn1.so.8.0.0
libbd_loop.so.2 -> libbd_loop.so.2.0.0
libXcursor.so.1 -> libXcursor.so.1.0.2
libGLdispatch.so.0 -> libGLdispatch.so.0.0.0
libboost_iostreams.so.1.65.1 -> libboost_iostreams.so.1.65.1
libebook-contacts-1.2.so.2 -> libebook-contacts-1.2.so.2.0.0
libboost_locale.so.1.65.1 -> libboost_locale.so.1.65.1
libcolord-gtk.so.1 -> libcolord-gtk.so.1.0.3
libpciaccess.so.0 -> libpciaccess.so.0.11.1
libxml2.so.2 -> libxml2.so.2.9.4
libtwolame.so.0 -> libtwolame.so.0.0.0
libgeocode-glib.so.0 -> libgeocode-glib.so.0.0.0
libxcb-keysyms.so.1 -> libxcb-keysyms.so.1.0.0
libpcsclite.so.1 -> libpcsclite.so.1.0.0
libraw.so.16 -> libraw.so.16.0.0
libatomic.so.1 -> libatomic.so.1.2.0
libexiv2.so.14 -> libexiv2.so.14.0.0
libetonyek-0.1.so.1 -> libetonyek-0.1.so.1.0.7
librevenge-0.0.so.0 -> librevenge-0.0.so.0.0.4
libxslt.so.1 -> libxslt.so.1.1.29
libcdda_paranoia.so.0 -> libcdda_paranoia.so.0.10.2
libcolorhug.so.2 -> libcolorhug.so.2.0.5
libcairo-gobject.so.2 -> libcairo-gobject.so.2.11510.0
libcanberra.so.0 -> libcanberra.so.0.2.5
libjson-glib-1.0.so.0 -> libjson-glib-1.0.so.0.400.2
libevview3.so.3 -> libevview3.so.3.0.0
libcaca++.so.0 -> libcaca++.so.0.99.19
libicui18n.so.60 -> libicui18n.so.60.2
libpwquality.so.1 -> libpwquality.so.1.0.2
libEGL.so.1 -> libEGL.so.1.0.0
libsasl2.so.2 -> libsasl2.so.2.0.25
libsoup-gnome-2.4.so.1 -> libsoup-gnome-2.4.so.1.8.0
libxkbfile.so.1 -> libxkbfile.so.1.0.2
libcanberra-gtk3.so.0 -> libcanberra-gtk3.so.0.1.9
libisl.so.19 -> libisl.so.19.0.0
libical-glib.so.3 -> libical-glib.so.3.0.1
libpspell.so.15 -> libpspell.so.15.2.0
libtotem-plparser.so.18 -> libtotem-plparser.so.18.1.1
libwmflite-0.2.so.7 -> libwmflite-0.2.so.7.0.1
libgtk-x11-2.0.so.0 -> libgtk-x11-2.0.so.0.2400.32
libvorbisenc.so.2 -> libvorbisenc.so.2.0.11
libI810XvMC.so.1 -> libI810XvMC.so.1.0.0
libnettle.so.6 -> libnettle.so.6.4
libgettextsrc-0.19.8.1.so -> libgettextsrc.so
libpangocairo-1.0.so.0 -> libpangocairo-1.0.so.0.4000.14
libnetsnmp.so.30 -> libnetsnmp.so.30.0.3
libgssapi_krb5.so.2 -> libgssapi_krb5.so.2.2
libedataserver-1.2.so.23 -> libedataserver-1.2.so.23.0.0
libgstbase-1.0.so.0 -> libgstbase-1.0.so.0.1405.0
libbabeltrace-lttng-live.so.1 -> libbabeltrace-lttng-live.so.1.0.0
libvncclient.so.1 -> libvncclient.so.1.0.0
libxcb.so.1 -> libxcb.so.1.1.0
libcolordprivate.so.2 -> libcolordprivate.so.2.0.5
libMagickCore-6.Q16.so.3 -> libMagickCore-6.Q16.so.3.0.0
libfftw3_threads.so.3 -> libfftw3_threads.so.3.5.7
libebackend-1.2.so.10 -> libebackend-1.2.so.10.0.0
libindicator3.so.7 -> libindicator3.so.7.0.0
libpanelw.so.5 -> libpanelw.so.5.9
libpangoxft-1.0.so.0 -> libpangoxft-1.0.so.0.4000.14
libmozjs-52.so.0 -> libmozjs-52.so.0.0.0
libclucene-shared.so.1 -> libclucene-shared.so.2.3.3.4
libmediaart-2.0.so.0 -> libmediaart-2.0.so.0.904.0
libxatracker.so.2 -> libxatracker.so.2.5.0
libsmbios_c.so.2 -> libsmbios_c.so.2.2.1
libxapian.so.30 -> libxapian.so.30.4.0
libtracker-sparql-2.0.so.0 -> libtracker-sparql-2.0.so.0.3.0
libiculx.so.60 -> libiculx.so.60.2
libtsan.so.0 -> libtsan.so.0.0.0
libgnutls.so.30 -> libgnutls.so.30.14.10
libcurl-gnutls.so.4 -> libcurl-gnutls.so.4.5.0
libwbclient.so.0 -> libwbclient.so.0.14
librtmp.so.1 -> librtmp.so.1
libsamba-hostconfig.so.0 -> libsamba-hostconfig.so.0.0.1
libXRes.so.1 -> libXRes.so.1.0.0
libasound.so.2 -> libasound.so.2.0.0
libefivar.so.1 -> libefivar.so.1.34
libsigsegv.so.2 -> libsigsegv.so.2.0.5
libgpgmepp.so.6 -> libgpgmepp.so.6.5.0
libvisual-0.4.so.0 -> libvisual-0.4.so.0.0.0
libepoxy.so.0 -> libepoxy.so.0.0.0
libXdamage.so.1 -> libXdamage.so.1.1.0
libart_lgpl_2.so.2 -> libart_lgpl_2.so.2.3.21
libxcb-dri3.so.0 -> libxcb-dri3.so.0.0.0
libndr-standard.so.0 -> libndr-standard.so.0.0.1
libgstriff-1.0.so.0 -> libgstriff-1.0.so.0.1405.0
libpixman-1.so.0 -> libpixman-1.so.0.34.0
libndr-krb5pac.so.0 -> libndr-krb5pac.so.0.0.1
libgusb.so.2 -> libgusb.so.2.0.10
libtevent.so.0 -> libtevent.so.0.9.34
libbd_part.so.2 -> libbd_part.so.2.0.0
libstdc++.so.6 -> libstdc++.so.6.0.25
libksba.so.8 -> libksba.so.8.11.6
libgoa-1.0.so.0 -> libgoa-1.0.so.0.0.0
libnotify.so.4 -> libnotify.so.4.0.0
libxcb-image.so.0 -> libxcb-image.so.0.0.0
libip6tc.so.0 -> libip6tc.so.0.1.0
libcogl-pango.so.20 -> libcogl-pango.so.20.4.2
libcamel-1.2.so.61 -> libcamel-1.2.so.61.0.0
libtotem-plparser-mini.so.18 -> libtotem-plparser-mini.so.18.1.1
libwebkit2gtk-4.0.so.37 -> libwebkit2gtk-4.0.so.37.37.6
libmpxwrappers.so.2 -> libmpxwrappers.so.2.0.1
libdconf.so.1 -> libdconf.so.1.0.0
libgstpbutils-1.0.so.0 -> libgstpbutils-1.0.so.0.1405.0
libicutu.so.60 -> libicutu.so.60.2
libgrlnet-0.3.so.0 -> libgrlnet-0.3.so.0.0.3
libeot.so.0 -> libeot.so.0.0.0
libdns-pkcs11.so.1100 -> libdns-pkcs11.so.1100.1.1
libasan.so.4 -> libasan.so.4.0.0
libcheese-gtk.so.25 -> libcheese-gtk.so.25.1.0
libqqwing.so.2 -> libqqwing.so.2.1.0
libsamdb.so.0 -> libsamdb.so.0.0.1
libisc.so.169 -> libisc.so.169.0.1
libclucene-core.so.1 -> libclucene-core.so.2.3.3.4
libIlmImfUtil-2_2.so.22 -> libIlmImfUtil-2_2.so.22.0.0
libssl3.so -> libssl3.so
libXfont2.so.2 -> libXfont2.so.2.0.0
libgbm.so.1 -> libgbm.so.1.0.0
libp11-kit.so.0 -> libp11-kit.so.0.3.0
libgstfft-1.0.so.0 -> libgstfft-1.0.so.0.1405.0
libxcb-sync.so.1 -> libxcb-sync.so.1.0.0
libgstapp-1.0.so.0 -> libgstapp-1.0.so.0.1405.0
libpython2.7.so.1.0 -> libpython2.7.so.1.0
libip4tc.so.0 -> libip4tc.so.0.1.0
libnetsnmpmibs.so.30 -> libnetsnmpmibs.so.30.0.3
libsamba-policy.so.0 -> libsamba-policy.so.0.0.1
libsmbconf.so.0 -> libsmbconf.so.0
libdjvulibre.so.21 -> libdjvulibre.so.21.6.0
libgdk-3.so.0 -> libgdk-3.so.0.2200.30
libXv.so.1 -> libXv.so.1.0.0
libbluetooth.so.3 -> libbluetooth.so.3.18.16
libxcb-res.so.0 -> libxcb-res.so.0.0.0
libpcap.so.0.8 -> libpcap.so.1.8.1
libXau.so.6 -> libXau.so.6.0.0
libirs.so.160 -> libirs.so.160.0.4
libtheoradec.so.1 -> libtheoradec.so.1.1.4
libstartup-notification-1.so.0 -> libstartup-notification-1.so.0.0.0
libxcb-util.so.1 -> libxcb-util.so.1.0.0
libpopt.so.0 -> libpopt.so.0.0.0
libavahi-glib.so.1 -> libavahi-glib.so.1.0.2
libldb.so.1 -> libldb.so.1.2.3
libgraphite2.so.3 -> libgraphite2.so.3.0.1
libfwupd.so.2 -> libfwupd.so.2.0.0
libv4lconvert.so.0 -> libv4lconvert.so.0.0.0
libdns.so.1100 -> libdns.so.1100.1.1
libxcb-xkb.so.1 -> libxcb-xkb.so.1.0.0
libfontenc.so.1 -> libfontenc.so.1.0.0
libGLX_mesa.so.0 -> libGLX_mesa.so.0.0.0
libgsttag-1.0.so.0 -> libgsttag-1.0.so.0.1405.0
libxcb-render-util.so.0 -> libxcb-render-util.so.0.0.0
liblsan.so.0 -> liblsan.so.0.0.0
libappindicator3.so.1 -> libappindicator3.so.1.0.0
libgeoclue-2.so.0 -> libgeoclue-2.so.0.0.0
libva.so.2 -> libva.so.2.600.0
libasyncns.so.0 -> libasyncns.so.0.3.1
libappstream-glib.so.8 -> libappstream-glib.so.8.0.10
libroken.so.18 -> libroken.so.18.1.0
libcdio_paranoia.so.2 -> libcdio_paranoia.so.2.0.0
libgssapi.so.3 -> libgssapi.so.3.0.0
libuv.so.1 -> libuv.so.1.0.0
libkrb5.so.3 -> libkrb5.so.3.3
libdebconfclient.so.0 -> libdebconfclient.so.0.0.0
libcdio.so.17 -> libcdio.so.17.0.0
libgirepository-1.0.so.1 -> libgirepository-1.0.so.1.0.0
libibus-1.0.so.5 -> libibus-1.0.so.5.0.517
librom1394.so.0 -> librom1394.so.0.3.0
libcupsfilters.so.1 -> libcupsfilters.so.1.0.0
libatspi.so.0 -> libatspi.so.0.0.1
libIexMath-2_2.so.12 -> libIexMath-2_2.so.12.0.0
liblirc_client.so.0 -> liblirc_client.so.0.6.0
libpng16.so.16 -> libpng16.so.16.34.0
libgmp.so.10 -> libgmp.so.10.3.2
libXinerama.so.1 -> libXinerama.so.1.0.0
libpango-1.0.so.0 -> libpango-1.0.so.0.4000.14
libimobiledevice.so.6 -> libimobiledevice.so.6.0.0
libgpod.so.4 -> libgpod.so.4.3.2
libspeexdsp.so.1 -> libspeexdsp.so.1.5.0
liblwres.so.160 -> liblwres.so.160.0.1
libIntelXvMC.so.1 -> libIntelXvMC.so.1.0.0
libwind.so.0 -> libwind.so.0.0.0
libxcb-xv.so.0 -> libxcb-xv.so.0.0.0
libgstgl-1.0.so.0 -> libgstgl-1.0.so.0.1405.0
libxkbcommon.so.0 -> libxkbcommon.so.0.0.0
libdbusmenu-gtk.so.4 -> libdbusmenu-gtk.so.4.0.12
libcupscgi.so.1 -> libcupscgi.so.1
libfribidi.so.0 -> libfribidi.so.0.3.6
libevdev.so.2 -> libevdev.so.2.1.20
libxtables.so.12 -> libxtables.so.12.0.0
libraw_r.so.16 -> libraw_r.so.16.0.0
libboost_filesystem.so.1.65.1 -> libboost_filesystem.so.1.65.1
libXmu.so.6 -> libXmu.so.6.2.0
liboauth.so.0 -> liboauth.so.0.8.7
libgthread-2.0.so.0 -> libgthread-2.0.so.0.5600.4
libdotconf.so.0 -> libdotconf.so.0.0.1
libGLU.so.1 -> libGLU.so.1.3.1
libbrotlicommon.so.1 -> libbrotlicommon.so.1.0.4
libprotobuf.so.10 -> libprotobuf.so.10.0.0
libhunspell-1.6.so.0 -> libhunspell-1.6.so.0.0.1
libxcb-shape.so.0 -> libxcb-shape.so.0.0.0
/lib:
/usr/lib:
libopencl_clang.so.8 -> libopencl_clang.so.8
libdrm_radeon.so.1 -> libdrm_radeon.so.1.0.1
libnetpbm.so.10 -> libnetpbm.so.10.0
libpqos.so.1 -> libpqos.so.1.2.0
libdrm.so.2 -> libdrm.so.2.4.0
libkms.so.1 -> libkms.so.1.0.0
libdrm_intel.so.1 -> libdrm_intel.so.1.0.0
libgjs.so.0 -> libgjs.so.0.0.0
libdrm_amdgpu.so.1 -> libdrm_amdgpu.so.1.0.0
libdrm_nouveau.so.2 -> libdrm_nouveau.so.2.0.0
/sbin/ldconfig.real: Can't create temporary cache file /etc/ld.so.cache~: Permission denied

mark@mark-box:~$ vainfo --display drm --device /dev/dri/renderD128
libva info: VA-API version 1.6.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_6
libva error: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed
libva info: va_openDriver() returns 1
vaInitialize failed with error code 1 (operation failed),exit
`

@Brainiarc7
Copy link
Author

Brainiarc7 commented Sep 24, 2019 via email

@mj43
Copy link

mj43 commented Sep 24, 2019

Running sudo ldconfig -vvvvvvI I get the same result haven't posted as didn't want to fill thread with duplicate info.
mediaSDK built as shown in this GIST section 4.
looking at compatible processors Cherry Trail is after Broadwell and is listed as part of Braswell family https://en.wikipedia.org/wiki/Intel_Quick_Sync_Video
I know openCL doesn't work but QSV is meant to be supported?
mark@mark-box:~$ clinfo Number of platforms 0

@Brainiarc7
Copy link
Author

Yeah QSV should work there.
If you really need OCL, use beignet.

@Anan5a
Copy link

Anan5a commented Nov 29, 2019

I would like to request a bash script.

Also the compilation of many encoder is not needed as they are in repository.

@y78078
Copy link

y78078 commented Dec 13, 2019

Hi Brainiarc7, thanks for the gist, it helps a lot.

I've done with this gist with some feedback, it would be nice if u take a look.

  1. I use Ubuntu 16.04.06 as my OS and update kernel to 4.15 to meet media SDK require (https://software.intel.com/en-us/articles/build-and-debug-open-source-media-stack)
  2. libdrm master branch now leads to Android project I think, so need to checkout to for example branch libdrm-2.4.100.
  3. Build Intel's MSDK: may cause errors with no CL/xxx.h or CL/xxx.hpp files while building samples, add "-DBUILD_SAMPLES=OFF" flag while cmake.
  4. library config file for the iMSDK: sudo nano /etc/ld.so.conf.d/imsdk.conf
    Intel's MSDK library sometimes will be at /opt/intel/mediasdk/lib64, so recommend to add this path to imsdk.conf

@Brainiarc7
Copy link
Author

Thank you @y78078 I'll take a look.

@lsandov1
Copy link

lsandov1 commented Feb 4, 2020

@Brainiarc7 this is great documentation. One minor comment: Above code snippets can be turned into a dockerfile. This would make like easier to quickly test the whole environment.

@Brainiarc7
Copy link
Author

@Isandov1 thanks for the suggestion, I'll give it a try.

@qxotic
Copy link

qxotic commented Apr 6, 2020

After first following these directions I was able to process a few files. Now I am getting errors.. mostly - error initializing the MFX video decoder. Any ideas?

Running this command: ffmpeg -hwaccel qsv -c:v h264_qsv -i "Charlie's Angels (1976) - S01E01 - Hellride".ts -c:v h264_qsv -global_quality 25 "Charlie's Angels (1976) - S01E01 - Hellride".mp4

I have attached the terminal copy as
NULL @ 0x556a6d5c20c0] SEI type 82 size 912 truncated at 832
[NULL @ 0x556a6d5c20c0] non-existing PPS 3 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 467
[NULL @ 0x556a6d5c20c0] non-existing PPS 3 referenced
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[NULL @ 0x556a6d5c20c0] SEI type 26 size 1528 truncated at 184
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 86
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] SEI type 114 size 1408 truncated at 128
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 66
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[NULL @ 0x556a6d5c20c0] SEI type 114 size 1416 truncated at 120
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 86
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] SEI type 114 size 1408 truncated at 128
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 66
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[NULL @ 0x556a6d5c20c0] SEI type 114 size 1416 truncated at 120
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 281
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[NULL @ 0x556a6d5c20c0] SEI type 90 size 912 truncated at 576
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 359
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[NULL @ 0x556a6d5c20c0] SEI type 253 size 1760 truncated at 88
[NULL @ 0x556a6d5c20c0] crop values invalid 0 0 24 1 / 16 32
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 48
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] SEI type 114 size 1408 truncated at 240
[NULL @ 0x556a6d5c20c0] illegal POC type 32
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 63
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[NULL @ 0x556a6d5c20c0] SEI type 114 size 1408 truncated at 128
[NULL @ 0x556a6d5c20c0] crop values invalid 0 16 2 0 / 16 32
[NULL @ 0x556a6d5c20c0] non-existing PPS 3 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 388
[NULL @ 0x556a6d5c20c0] non-existing PPS 3 referenced
[NULL @ 0x556a6d5c20c0] SEI type 174 size 1264 truncated at 88
[NULL @ 0x556a6d5c20c0] log2_max_frame_num_minus4 out of range (0-12): 27
[NULL @ 0x556a6d5c20c0] non-existing PPS 3 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 536
[NULL @ 0x556a6d5c20c0] non-existing PPS 3 referenced
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[NULL @ 0x556a6d5c20c0] SEI type 201 size 2024 truncated at 648
[NULL @ 0x556a6d5c20c0] log2_max_poc_lsb (30) is out of range
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 66
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] SEI type 114 size 1408 truncated at 112
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 65
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[NULL @ 0x556a6d5c20c0] SEI type 114 size 1416 truncated at 120
[NULL @ 0x556a6d5c20c0] illegal POC type 3
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 66
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] SEI type 114 size 1408 truncated at 112
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 65
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[NULL @ 0x556a6d5c20c0] SEI type 114 size 1416 truncated at 120
[NULL @ 0x556a6d5c20c0] illegal POC type 3
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 273
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[NULL @ 0x556a6d5c20c0] SEI type 90 size 912 truncated at 640
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 380
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[NULL @ 0x556a6d5c20c0] SEI type 4 size 568 truncated at 128
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 60
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] SEI type 114 size 1408 truncated at 64
[NULL @ 0x556a6d5c20c0] illegal POC type 32
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 57
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[NULL @ 0x556a6d5c20c0] SEI type 114 size 1408 truncated at 184
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 314
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[NULL @ 0x556a6d5c20c0] SEI type 90 size 912 truncated at 768
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 407
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[NULL @ 0x556a6d5c20c0] SEI type 252 size 1496 truncated at 112
[NULL @ 0x556a6d5c20c0] illegal POC type 5
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 74
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] SEI type 114 size 1408 truncated at 96
[NULL @ 0x556a6d5c20c0] illegal POC type 6
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 68
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[NULL @ 0x556a6d5c20c0] SEI type 114 size 1408 truncated at 112
[NULL @ 0x556a6d5c20c0] crop values invalid 1 0 0 113 / 752 48
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 77
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] SEI type 114 size 1408 truncated at 96
[NULL @ 0x556a6d5c20c0] illegal POC type 21
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 66
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[NULL @ 0x556a6d5c20c0] SEI type 114 size 1408 truncated at 104
[NULL @ 0x556a6d5c20c0] crop values invalid 1 0 0 117 / 752 48
[NULL @ 0x556a6d5c20c0] non-existing PPS 3 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 356
[NULL @ 0x556a6d5c20c0] non-existing PPS 3 referenced
[NULL @ 0x556a6d5c20c0] SEI type 157 size 1496 truncated at 16
[NULL @ 0x556a6d5c20c0] non-existing PPS 3 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 452
[NULL @ 0x556a6d5c20c0] non-existing PPS 3 referenced
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[NULL @ 0x556a6d5c20c0] SEI type 103 size 744 truncated at 240
[NULL @ 0x556a6d5c20c0] illegal POC type 32
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 48
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] SEI type 114 size 1408 truncated at 88
[NULL @ 0x556a6d5c20c0] illegal aspect ratio
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 67
[NULL @ 0x556a6d5c20c0] non-existing PPS 4 referenced
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[NULL @ 0x556a6d5c20c0] SEI type 114 size 1408 truncated at 96
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 573
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[NULL @ 0x556a6d5c20c0] SEI type 94 size 1992 truncated at 696
[NULL @ 0x556a6d5c20c0] too many reference frames 32
[NULL @ 0x556a6d5c20c0] sps_id 8 out of range
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 720
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[NULL @ 0x556a6d5c20c0] SEI type 83 size 1520 truncated at 632
[NULL @ 0x556a6d5c20c0] illegal POC type 3
[NULL @ 0x556a6d5c20c0] sps_id 8 out of range
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 50
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[NULL @ 0x556a6d5c20c0] SEI type 106 size 1408 truncated at 120
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 36
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[NULL @ 0x556a6d5c20c0] SEI type 106 size 1408 truncated at 96
[NULL @ 0x556a6d5c20c0] illegal aspect ratio
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 565
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[NULL @ 0x556a6d5c20c0] SEI type 239 size 792 truncated at 352
[NULL @ 0x556a6d5c20c0] log2_max_poc_lsb (21) is out of range
[NULL @ 0x556a6d5c20c0] sps_id 8 out of range
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[NULL @ 0x556a6d5c20c0] missing picture in access unit with size 654
[NULL @ 0x556a6d5c20c0] non-existing PPS 0 referenced
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
[h264_qsv @ 0x556a6d884700] Error initializing the MFX video decoder: invalid video parameters (-15)
Error while decoding stream #0:0: Invalid argument
Too many packets buffered for output stream 0:1.
[aac @ 0x556a6d791a40] Qavg: 207.883
[aac @ 0x556a6d791a40] 2 frames left in the queue on closing
Conversion failed!

lspci - output
00:00.0 Host bridge: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers (rev 07)
00:02.0 VGA compatible controller: Intel Corporation Device 3e92
00:14.0 USB controller: Intel Corporation 200 Series/Z370 Chipset Family USB 3.0 xHCI Controller
00:14.2 Signal processing controller: Intel Corporation 200 Series PCH Thermal Subsystem
00:16.0 Communication controller: Intel Corporation 200 Series PCH CSME HECI #1
00:17.0 SATA controller: Intel Corporation 200 Series PCH SATA controller [AHCI mode]
00:1b.0 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #17 (rev f0)
00:1c.0 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #1 (rev f0)
00:1c.2 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #3 (rev f0)
00:1c.4 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #5 (rev f0)
00:1d.0 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #9 (rev f0)
00:1f.0 ISA bridge: Intel Corporation Z370 Chipset LPC/eSPI Controller
00:1f.2 Memory controller: Intel Corporation 200 Series/Z370 Chipset Family Power Management Controller
00:1f.3 Audio device: Intel Corporation 200 Series PCH HD Audio
00:1f.4 SMBus: Intel Corporation 200 Series/Z370 Chipset Family SMBus Controller
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-V
03:00.0 Network controller: Intel Corporation Wireless 8265 / 8275 (rev 78)
3d:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM961/PM961

vainfo - output
vainfo: VA-API version: 1.7 (libva 2.7.0.pre1)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 20.2.pre (3c01570e)
vainfo: Supported profile and entrypoints
VAProfileNone : VAEntrypointVideoProc
VAProfileNone : VAEntrypointStats
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointFEI
VAProfileH264Main : VAEntrypointEncSliceLP
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointFEI
VAProfileH264High : VAEntrypointEncSliceLP
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointFEI
VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileVP8Version0_3 : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointFEI
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointEncSlice
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD

buildconf - output

configuration:
--pkg-config-flags=--static
--enable-static
--disable-shared
--prefix=/home/mate/ffmpeg_build
--bindir=/home/mate/bin
--extra-cflags=-I/home/mate/ffmpeg_build/include
--extra-ldflags=-L/home/mate/ffmpeg_build/lib
--extra-cflags=-I/opt/intel/mediasdk/include
--extra-ldflags=-L/opt/intel/mediasdk/lib
--extra-ldflags=-L/opt/intel/mediasdk/plugins
--enable-libmfx
--enable-vaapi
--enable-opencl
--disable-debug
--enable-libvorbis
--enable-libvpx
--enable-libdrm
--enable-gpl
--enable-runtime-cpudetect
--enable-libfdk-aac
--enable-libx264
--enable-libx265
--enable-openssl
--enable-pic
--extra-libs='-lpthread -lm -lz -ldl'
--enable-nonfree

@Brainiarc7
Copy link
Author

Try this instead:

ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -i "Charlie's Angels (1976) - S01E01 - Hellride".ts  -vf "hwupload=extra_hw_frames=64,format=qsv" -c:v h264_qsv -global_quality 25 "Charlie's Angels (1976) - S01E01 - Hellride".mp4

And report back.

@qxotic
Copy link

qxotic commented Apr 8, 2020

That works. The files are not as small as I was getting when my other scripts worked. Could I adjust that by adjusting the "global" number?

I have this running as a bash script and a for loop to do a season at a time. My initial test line was: ffmpeg -hwaccel qsv -c:v h264_qsv -i "$f" -c:v h264_qsv /mnt/Plex/BobTemp/Temp/"${f%.ts}.mp4" And at first that was working fine too.. on a movie and a couple other episodes..when I ran it as the script they all failed.. then I tried the command I posted earlier..that worked on a episode....and again failed when I ran the script.

This script worked but the result was an even larger file. ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -i "Charlie's Angels (1976) - S01E01 - Hellride" -vf hwupload=extra_hw_frames=64,format=qsv -c:v h264_qsv -b:v 5M -maxrate 5M "Charlie's Angels (1976) - S01E01 - Hellride".mp4

I thank you for giving me the answer that works. If you have time can you shed some light on why the others didn't always work. Will this same set of instructions work on Ubuntu 20.04?

Thanks again for the awesome help!

@Robbi373
Copy link

Hi there,
First of all thank you very much for the gist!
One thing I'd liked to mention for anyone interested in building an --enable-shared (-fPIC-enabled) version, to be able to build other projects using your own compiled ffmpeg version: This does not work with the master branch (currently?). It worked for me on the release/4.2 branch, or when downloading the 4.2.2 source tar file.
...This was way too annoying to find out. :D

@jhallard
Copy link

libdrm no longer has an autogen.sh at the top level... I had to get it from here https://github.com/Distrotech/libdrm

@Brainiarc7
Copy link
Author

That works. The files are not as small as I was getting when my other scripts worked. Could I adjust that by adjusting the "global" number?

I have this running as a bash script and a for loop to do a season at a time. My initial test line was: ffmpeg -hwaccel qsv -c:v h264_qsv -i "$f" -c:v h264_qsv /mnt/Plex/BobTemp/Temp/"${f%.ts}.mp4" And at first that was working fine too.. on a movie and a couple other episodes..when I ran it as the script they all failed.. then I tried the command I posted earlier..that worked on a episode....and again failed when I ran the script.

This script worked but the result was an even larger file. ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -i "Charlie's Angels (1976) - S01E01 - Hellride" -vf hwupload=extra_hw_frames=64,format=qsv -c:v h264_qsv -b:v 5M -maxrate 5M "Charlie's Angels (1976) - S01E01 - Hellride".mp4

I thank you for giving me the answer that works. If you have time can you shed some light on why the others didn't always work. Will this same set of instructions work on Ubuntu 20.04?

Thanks again for the awesome help!

Hello there,

Apologies for the late reply. I'm so rarely on gists.

With QuickSync, you're negotiating with the MFX run-time. And in every instance, ffmpeg must initialize its' devices strictly or it will fail.
This gets even messier with multiple GPUs on the platform, as you'll find out when Intel Xe discrete GPUs launch. These with Radeon RX Vega cards on specific combinations, such as the Intel NUC, have also experienced similar headaches.

For control over encoded file sizes, you must understand how rate control works in QuickSync.

For the QSV run-time, the following rate control methods are available:

The rate control method is selected as follows:

i. When -global_quality is specified, a quality-based mode is used. Specifically this means either:

  • CQP - constant quantizer scale, when the qscale codec flag is also set (the -qscale ffmpeg option).
  • LA_ICQ - intelligent constant quality with lookahead, when the look_ahead option is also set.
  • ICQ – intelligent constant quality otherwise.

ii. Otherwise, a bit-rate-based mode is used. For all of those, you should specify at least the desired average bitrate with the -b:v option:

  • LA - VBR with lookahead, when the look_ahead option is specified.
  • CBR - constant bitrate, when maxrate is specified and equal to the average bitrate.
  • VBR - variable bitrate, when maxrate is specified, but is higher than the average bitrate.
  • AVBR - average VBR mode, when maxrate is not specified. This mode is further configured by the -avbr_accuracy and -avbr_convergence private codec options.

If you're to maintain specific sizes, set bitrates as explained above.
For quality-based encodes, note the caveats noted above.

@nikpakar
Copy link

nikpakar commented Mar 2, 2021

Hello Brainiarc7,

Many thanks for excellent document. May i ask a quick question. Without going through manually, can we follow this approach to install qsv support for ffmpeg ?

sudo apt-get install libva-dev libmfx-dev
./configure --enable-libmfx && make -j8 && make install

I can see all the support are been enabled, but im struggling get a working command pipeline. Can some one please help me with the command pipeline to achieve the below.

ffmpeg input decklink, encode hevc_qsv, output srt://

Highly appreciate any sort of help on this.

Thanks
-Nik

@lkraav
Copy link

lkraav commented Apr 14, 2021

Beautiful, it all works.

Figured out a cmdline that dropped gphoto2 --capture-movie pipe into v4l2loopback device CPU usage from 28% -> 8%

$ gphoto2 --stdout --capture-movie | ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -c:v mjpeg_qsv -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0

I'm a complete ffmpeg newb - can this cmdline be optimized further?

For example, a more clear (to a newb eye) parameter set produced an format conversion error:

$ ... | ffmpeg -hwaccel qsv -c:v mjpeg_qsv -i - ...

@Brainiarc7 can you shed light on why that magic-like -init_hw_device stuff works, and -hwaccel -c:v combo doesn't.

@Brainiarc7
Copy link
Author

Brainiarc7 commented Apr 23, 2021 via email

@abishekmuthian
Copy link

Couple of changes I had to do for installing in Ubuntu 20.04

libdrm doesn't have autoconfig, it's built using meson

But it couldn't find libpciaccess even after installing libpciaccess-dev, So had to build and install libpciaccess first

cd ~/vaapi
git clone https://gitlab.freedesktop.org/xorg/lib/libpciaccess.git
cd libpciaccess
./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu
time make -j$(nproc) VERBOSE=1
sudo make -j$(nproc) install
sudo ldconfig -vvvv

Set the pkgconfig path

export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/

Then continue installing libdrm and other packages as in OP but note that many of the repositories have been migrated to GitHub.

For intel <8+ gen i.e. anything lesser than Boradwell iHD driver doesn't work and so i965 with vaapi is the best bet for HW acceleration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment