[FFmpeg-user] Compiling ffmpeg with libmfx

Maxim Kozlov rogat1y at gmail.com
Sat Oct 10 16:12:31 CEST 2015


Got it!

How to compile sdk + ffmpeg on ubuntu 12.04.5. server
1. apt-get install gcc gobjc pkg-config libpthread-stubs0-dev
libpciaccess-dev make patch yasm g++ autoconf cmake \
automake build-essential libass-dev libfreetype6-dev libgpac-dev
libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev
libx11-dev \
libxext-dev libxfixes-dev texi2html zlib1g-dev libx264-dev libmp3lame-dev
libfaac-dev librtmp-dev libvo-aacenc-dev libx264-dev cifs-utils

2. Media Server Studio Essentials 2015r6
wget http://.../mediaserverstudioessentials2015r6.tar.gz
tar xf mediaserverstudioessentials2015r6.tar.gz
cd MediaServerStudioEssentials2015R6
tar xf SDK2015Production16.4.2.1.tar.gz
cd SDK2015Production16.4.2.1/Generic/
tar xf intel-linux-media-ocl_generic_16.4.2.1-39163_64bit.tar.gz
./install_media.sh

3. libdrm
cd /opt/intel/mediasdk/opensource/libdrm/2.4.54-39163/
tar xf libdrm-2.4.54.tar.bz2
cd libdrm-2.4.54
./configure
make -j 8
make install

4. libva
cd /opt/intel/mediasdk/opensource/libva/1.3.1-staging.20130628.39163
tar xf libva-1.3.1.tar.bz2
cd libva-1.3.1
./configure --enable-static
make
make install

5. libmfx
cd /opt/intel/mediasdk/opensource/mfx_dispatch/
mkdir build
cd build
cmake –D__ARCH:STRING=intel64 ../
make -j 8
ln -s /opt/intel/mediasdk/include/ /usr/local/include/mfx

6. libs
cd /usr/local/lib
ln -sf /opt/intel/mediasdk/opensource/mfx_dispatch/build/__lib/libmfx.a
ln -sf
/opt/intel/mediasdk/opensource/mfx_dispatch/build/__lib/libdispatch_trace.a
ln -sf
/opt/intel/mediasdk/opensource/mfx_dispatch/build/__lib/libdispatch_shared.a
ln -sf
/opt/intel/mediasdk/opensource/libva/1.3.1-staging.20130628.39163/libva-1.3.1/va/.libs/libva.a
ln -sf
/opt/intel/mediasdk/opensource/libva/1.3.1-staging.20130628.39163/libva-1.3.1/va/.libs/libva-drm.a
ln -sf
/opt/intel/mediasdk/opensource/libva/1.3.1-staging.20130628.39163/libva-1.3.1/va/.libs/libva-tpi.a

7. create file /usr/lib/pkgconfig/libmfx.pc:
prefix=/usr/local
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include

Name: libmfx
Description: Intel Media SDK Dispatched static library
Version: 2015
Requires:
Requires.private:
Conflicts:
Libs: -L${libdir} -lmfx -ldispatch_shared -lva -lva-drm -lsupc++ -lstdc++
-ldl
Libs.private:
Cflags: -I${includedir}
-I/opt/intel/mediasdk/opensource/mfx_dispatch/include

8. add to /etc/environment:
LD_LIBRARY_PATH="/usr/local/lib:/usr/lib64"
LIBVA_DRIVER_NAME=iHD
LIBVA_DRIVERS_PATH=/opt/intel/mediasdk/lib64

9. linux-kernel patch
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.5.tar.xz
tar xf linux-3.14.5.tar.xz
cd linux-3.14.5
cp
/opt/intel/mediasdk/opensource/patches/kmd/3.14.5/intel-kernel-patches.tar.bz2
.
tar xf intel-kernel-patches.tar.bz2
for i in intel-kernel-patches/*.patch; do patch -p1 < $i; done
make olddefconfig
make -j 8
make modules_install
make install
reboot

10. ffmpeg will be installed to /opt/ffmpeg_qsv/
wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xf ffmpeg-snapshot.tar.bz2
cd ffmpeg
./configure --disable-shared --enable-static --enable-gpl --enable-nonfree
--enable-fontconfig --enable-libfaac --enable-libfreetype \
--enable-libmp3lame --enable-librtmp --enable-libvo-aacenc --enable-libx264
--enable-version3 --enable-ffplay --disable-doc \
--disable-ffserver --enable-pthreads --enable-filters --enable-libvorbis
--enable-libtheora --enable-runtime-cpudetect --enable-libass \
--enable-bzlib --enable-zlib --prefix=/opt/ffmpeg_qsv/ --enable-libmfx
make -j 8
make install

2015-10-01 12:39 GMT+03:00 Maxim Kozlov <rogat1y at gmail.com>:

> Hi.
>
> Trying to compile latest ffmpeg with libmfx(intel quick sync) support
> under Ubuntu 12.04.5 LTS.
>
> What i've done.
> 1. installed Intel Media Server Studio Essentials 2015r6
>
> wget http://..../mediaserverstudioessentials2015r6.tar.gz
> tar xf mediaserverstudioessentials2015r6.tar.gz
> cd MediaServerStudioEssentials2015R6
> tar xf SDK2015Production16.4.2.1.tar.gz
> cd SDK2015Production16.4.2.1/Generic/
> tar xf intel-linux-media-ocl_generic_16.4.2.1-39163_64bit.tar.gz
> ./install_media.sh
>
> 2. compiled and installed libdrm
> cd /opt/intel/mediasdk/opensource/libdrm/2.4.54-39163/
> tar xf libdrm-2.4.54.tar.bz2
> cd libdrm-2.4.54
> ./configure
> make
> make install
>
> 3. compiled and installed libva
> cd /opt/intel/mediasdk/opensource/libva/1.3.1-staging.20130628.39163
> tar xf libva-1.3.1.tar.bz2
> cd libva-1.3.1
> ./configure
> make
> make install
>
> 4. compiled and installed libmfx
> cd /opt/intel/mediasdk/opensource/mfx_dispatch/
> mkdir build
> cd build
> cmake –D__ARCH:STRING=intel64 ../
> make
> cp /opt/intel/mediasdk/opensource/mfx_dispatch/build/__lib/libmfx.a
> /usr/local/lib/libmfx.a
> ln -s /opt/intel/mediasdk/include/ /usr/local/include/mfx
>
> 5. created file /usr/lib/pkgconfig/libmfx.pc:
>
> prefix=/usr/local
> exec_prefix=${prefix}
> libdir=${prefix}/lib
> includedir=${prefix}/include
>
> Name: libmfx
> Description: Intel Media SDK Dispatched static library
> Version: 2015
> Requires:
> Requires.private:
> Conflicts:
> Libs: -L${libdir} -lsupc++ ${libdir}/libmfx.a
> Libs.private:
> Cflags: -I${includedir}
> -I/opt/intel/mediasdk/opensource/mfx_dispatch/include
>
> 6. added to /etc/environment:
> LD_LIBRARY_PATH="/usr/local/lib;/usr/lib64"
> LIBVA_DRIVER_NAME=iHD
> LIBVA_DRIVERS_PATH=/opt/intel/mediasdk/lib64
>
> 7. Patched linux kernel:
> wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.5.tar.xz
> tar xf linux-3.14.5.tar.xz
> cd linux-3.14.5
> cp
> /opt/intel/mediasdk/opensource/patches/kmd/3.14.5/intel-kernel-patches.tar.bz2
> .
> for i in intel-kernel-patches/*.patch; do patch -p1 < $i; done
> make olddefconfig
> make -j 8
> make modules_install
> make install
>
> 8. try to compile ffmpeg
> wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
> tar xf ffmpeg-snapshot.tar.bz2
> cd ffmpeg
> ./configure --enable-libmfx
>
> ERROR: libmfx not found using pkg-config
>
> If you think configure made a mistake, make sure you are using the latest
> version from Git.  If the latest version fails, report the problem to the
> ffmpeg-user at ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
> Include the log file "config.log" produced by configure as this will help
> solve the problem.
>
> config.log - http://pastebin.com/Sw7s87NR
>
>
> What can be wrong?
>


More information about the ffmpeg-user mailing list