Media (Intel® oneAPI Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools from Intel. This includes Intel® oneAPI Video Processing Library and Intel® Media SDK.
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
2935 Discussions

Getting Intel Media Server Studio working with FFMPEG on Ubuntu 14.04



I have Ubuntu 14.04 installed on a machine with an Intel i7-4700EQ processor and an Intel Haswell Mobile integrated graphics card.

I've followed the Intel Media Server Studio 2016 community edition installation steps for a generic Linux OS described in the Media Server Studio Getting Started Guide.  I was able to run the generic install script without any errors, rebuild libdrm (using switch --prefix=/usr/local) and libva (using switches --prefix=/usr/local and --with-drivers-path=/opt/intel/mediasdk/lib64) successfully, and patch and build the 3.14.5 Linux kernel. "Uname -r" confirms I am using the proper kernel, "lsmod" confirms I have the i915 driver loaded and running. Vainfo reports VA-API version 0.99.0, driver name 'iHD', Driver version, return codes of 0 for va_getDriverName() and va_openDriver(), and gives a list of entry points for various VAProfiles. I am able to successfully encode h264 video files using the sample_multi_transcode binary using both in the MediaSamples folder using both -hw and -sw switches.

I compiled and installed mfx_dispatch from the source code in this github repo using switches --prefix=/usr and --enable-shared without any issues. I compiled and installed ffmpeg from the official github repo, with switches --enable-gpl --enable-libmfx --enable-ffplay --enable-opencl --enable-nonfree --enable-libmfx --enable-pthreads --enable-pic --enable-shared --extra-cflags=-fPIC --extra-ldexeflags=-pie, again without any issues. Running the command "ffmpeg -hwaccels" lists qsv and vaapi as available, and running "ffmpeg -codecs | grep qsv" gives the expected list of _qsv codecs. However, when I run "ffmpeg -i ~/MediaServerStudio/MediaSamples/content/test_stream.264 -an -v:c h264_qsv out.mp4" I get an message saying "Error initializing internal MFX session". I get the same error attempting to encode with other _qsv codecs, but am able to encode the video successfully with ffmpeg using the software h264 codec libx264.

Strace of the failed ffmpeg encoding shows that /usr/lib, /lib, and /usr/local/lib are being searched for, and that is not being found. is located in /opt/intel/mediasdk/lib64 and is a symboilc link to /opt/intel/mediasdk/lib64/ I've tried linking /opt/intel/mediasdk/lib64 to /lib, /usr/lib, and /usr/local/lib with no success.

I've been stuck on this for several weeks and any advice you can give would be appreciated.

0 Kudos
3 Replies


The problem is with mfx_dispatch: after adding an mfx.conf file containing the line "/opt/intel/mediasdk/lib64" to /etc/ I no longer get the error, the command line just hangs. libmfx.pc is in /usr/lib/pkgconfig and contains the following:





Name: libmfx

DescriptionL Intel Media SDK Dispatched static library

Version: 1/16

Libs: -L${libdir} -lmfx -lstdc++ -ldl -L/usr/local/lib -lva-drm -lva -L/usr/local/lib -lva-x11 -lva


Cflags: -I${includedir}

I've tried rebuilding mfx_dispatch as a static library but when running ffmpeg I get the error "Can't open shared library." Any thoughts?


Hi There,

Have you referred the article: FFmpeg installation and validation ?

And you can also find mfx_dispatch source code under /opt/intel/mediasdk/opensource/mfx_dispatch.

Hope these can help.






Thanks for getting back to me so quickly. Is there an article containing more information on setting up mfx_dispatch? None of the set up guides including the article you posted have information detailed enough to be helpful. I've isolate the problem to mfx_dispatch since vainfo and lsmod give the correct output, the Media Server Studio multi_transcode sample works, and ffmpeg works with other video codecs. When I run "strace ffmpeg -i <input file> -an -c:v h264_qsv out.mp4", I see that ffmpeg is able to find and read from in /opt/intel/mediasdk/lib64, but then the thread exits and the process hangs.