Accessing Intel® Media Server Studio for Linux* codecs with FFmpeg

签署人: Jeffrey McAllister

已发布:01/31/2017   最后更新时间:01/31/2017

Intel hardware accelerated codecs are now accessible via FFmpeg* on Linux* systems where Intel® Media Server Studio is installed. The same OS and platform requirements apply, as the new additions to FFmpeg are simple wrappers to bridge the APIs.  For more information on Intel Media Server Studio requirements please see the Release Notes and Getting Started Guide.  

To get started:

  1. Install Intel Media Server Studio for Linux.  A free community edition is available from
  2. Get the latest FFmpeg source from  Intel Quick Sync Video support is available in FFmpeg 2.8 and newer for those who prefer a stable release.  Development is active so anyone needing latest updates and fixes should check the git repository tip.
  3. Configure FFmpeg with "--enable-libmfx --enable-nonfree", build, and install.  This requires copying include files to /opt/intel/mediasdk/include/mfx and adding a libmfx.pc file.  More details below.
  4. Transcode with an accelerated codec such as "-vcodec h264_qsv" on the ffmpeg command line.  Performance boost increases with resolution.
ffmpeg -i in.mp4  -vcodec h264_qsv out_qsv.mp4


Additional configure info:

The *_qsv codecs are enabled with "configure --enable-libmfx --enable-nonfree".  

A few additional steps are required for configure to work with Intel Media Server Studio codecs.

1. copy the mediasdk header files to include/mfx

# mkdir /opt/intel/mediasdk/include/mfx
# cp /opt/intel/mediasdk/include/*.h /opt/intel/mediasdk/include/mfx

2. provide a libmfx.pc file.  Same search rules apply as for other pkg-config configurations.  A good place to start is the same directory as an already findable config like libdrm.pc, but the PKG_CONFIG_PATH environment variable can be used to customize the search path.

example libmfx.pc file


Name: libmfx
Description: Intel Media SDK
Version: 16.4.2
Libs: -L${libdir} -lmfx -lva -lstdc++ -ldl -lva-drm -ldrm
Cflags: -I${includedir} -I/usr/include/libdrm


Validation notes:

While this solution is known to work on a wide variety of systems, here are the most tested configurations:


Intel® Xeon® Processors and Intel® Core™ Processors with support for Intel® Quick Sync Video

OS CentOS7.2 (3.10.0-327.36.3.el7.x86_64)
Software Gold CentOS install of Intel® Media Server Studio 2017 R2




性能因用途、配置和其他因素而异。请访问 了解更多信息。