You are not logged in.

#1 2015-06-22 11:06:50

zAo
Member
Registered: 2012-11-01
Posts: 26

pkg-config doesn't find libmfx

Hi,

I'm trying to build ffmpeg with h264_qsv (QuickSync) support. In order to do that, I need libmfx. But pkg-config doesn't find the libmfx files, although they are present:

PKG_CONFIG_PATH is filled with the correct path:

[root@nuc FFmpeg]# echo $PKG_CONFIG_PATH
/usr/lib/pkgconfig/

The libmfx files are there:

[root@nuc FFmpeg]# ls -l /usr/lib/pkgconfig/libmfx.*
-rw-r--r-- 1 root root 120284 Jun 20 19:25 /usr/lib/pkgconfig/libmfx.a
-rwxr-xr-x 1 root root    893 Jun 20 19:25 /usr/lib/pkgconfig/libmfx.la
-rw-r--r-- 1 root root    339 Jun 20 20:05 /usr/lib/pkgconfig/libmfx.pc

The libmfx.pc contents seems ok?

[root@nuc FFmpeg]# cat /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: 2013
Requires:
Requires.private:
Conflicts:
Libs: -L${libdir} -lsupc++ ${libdir}/libmfx.a
Libs.private:
Cflags: -I${includedir} -I/media/downloads/opensource/SDK/include/

The header files are at the included in the SDK dir:

[root@nuc FFmpeg]# ls -l /media/downloads/opensource/SDK/include/
total 168
-rw-r--r-- 1 zao zao  4835 Jun  3 09:58 mfxastructures.h
-rw-r--r-- 1 zao zao  5479 Jun  3 09:58 mfxaudio++.h
-rw-r--r-- 1 zao zao  3493 Jun  3 10:02 mfxaudio.h
-rw-r--r-- 1 zao zao  4767 Jun  3 10:00 mfxcommon.h
-rw-r--r-- 1 zao zao  6306 Jun  3 09:58 mfxdefs.h
-rw-r--r-- 1 zao zao  2865 Jun  3 10:00 mfxenc.h
-rw-r--r-- 1 zao zao  2976 Jun  3 09:58 mfxjpeg.h
-rw-r--r-- 1 zao zao  2900 Jun  3 10:00 mfxla.h
-rw-r--r-- 1 zao zao  3048 Jun  3 09:58 mfxmvc.h
-rw-r--r-- 1 zao zao  2881 Jun  3 09:58 mfxpak.h
-rw-r--r-- 1 zao zao 28117 Jun  3 09:58 mfxplugin++.h
-rw-r--r-- 1 zao zao 11066 Jun  3 10:00 mfxplugin.h
-rw-r--r-- 1 zao zao  2647 Jun  3 09:58 mfxsession.h
-rw-r--r-- 1 zao zao 38541 Jun  3 10:00 mfxstructures.h
-rw-r--r-- 1 zao zao 10411 Jun  3 10:00 mfxvideo++.h
-rw-r--r-- 1 zao zao  6257 Jun  3 10:00 mfxvideo.h
-rw-r--r-- 1 zao zao  2690 Jun  3 09:58 mfxvp8.h
-rw-r--r-- 1 zao zao  1662 Jun  3 09:58 mfxvstructures.h

But configure cant't find the files:

[root@nuc FFmpeg]# git pull
Already up-to-date.
[root@nuc FFmpeg]# ./configure --enable-libmfx --enable-nonfree --enable-iconv --arch=x86 --disable-debug --disable-shared --disable-doc --disable-w32threads --enable-gpl --enable-version3 --enable-runtime-cpudetect --enable-avfilter --enable-bzlib --enable-zlib --enable-librtmp --enable-gnutls --enable-avisynth --enable-frei0r --enable-filter=frei0r --enable-libbluray --enable-libcaca --enable-libopenjpeg --enable-fontconfig --enable-libfreetype --enable-libass --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libsoxr --enable-libtwolame --enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvorbis --enable-libvo-aacenc --enable-libopus --enable-libvidstab --enable-libvpx --enable-libwavpack --enable-libxavs --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzvbi
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@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.

Sorry for being new at this, but I really want to learn smile

Thanks in advance, zAo

Offline

#2 2015-06-22 11:18:39

ayekat
Member
Registered: 2011-01-17
Posts: 1,599

Re: pkg-config doesn't find libmfx

./configure wrote:

Include the log file "config.log" produced by configure as this will help solve the problem.

smile

Also, is there a specific reason why you are compiling something as the root user?

And:

zAo wrote:
[root@nuc FFmpeg]# ls -l /usr/lib/pkgconfig/libmfx.*
-rw-r--r-- 1 root root 120284 Jun 20 19:25 /usr/lib/pkgconfig/libmfx.a
-rwxr-xr-x 1 root root    893 Jun 20 19:25 /usr/lib/pkgconfig/libmfx.la
-rw-r--r-- 1 root root    339 Jun 20 20:05 /usr/lib/pkgconfig/libmfx.pc

Is there a reason why the .a and .la files are in /usr/lib/pkgconfig? Shouldn't they usually be in /usr/lib?


pkgshackscfgblag

Offline

#3 2015-06-22 11:31:04

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,026

Re: pkg-config doesn't find libmfx

*.a and *.la files are not supposed to be in /usr/lib/pkgconfig .

/usr/lib/pkgconfig/libmfx.pc expects files for libmfx to be present under /usr/local , /usr/locall/lib & /usr/local/include .
I don't see a package for libmfx in repos, AUR3 or AUR4, where did you get it from ?

AUR has several packages with intel sdk , which sdk are you trying to use ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#4 2015-06-22 11:41:57

zAo
Member
Registered: 2012-11-01
Posts: 26

Re: pkg-config doesn't find libmfx

No particular reason to compile with root, but some files were owned by root and I wanted to exclude security related problems.

I uploaded config.log here: http://sbkg0002.home.xs4all.nl/config.log

The libmfx files are also in /usr/lib/, but I made copies to differt places since I didn't know what I was doing smile

[zao@nuc FFmpeg]$ ls -l /usr/lib/libmfx.*
-rw-r--r-- 1 root root 120284 Jun 22 11:40 /usr/lib/libmfx.a
-rwxr-xr-x 1 root root    893 Jun 22 11:40 /usr/lib/libmfx.la

Edit:
Libmfx is from here:
https://github.com/lu-zero/mfx_dispatch

Last edited by zAo (2015-06-22 11:43:31)

Offline

#5 2015-06-22 11:47:34

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,626
Website

Re: pkg-config doesn't find libmfx

zAo wrote:

... some files were owned by root and I wanted to exclude security related problems.

That will not exclude security problems.  It will create them.  If your solution to a problem you don't understand is to try again with root, you will sooner or later, completely destroy your system (if you haven't already).  Stop.

zAo wrote:

but I made copies to differt places

Remove these to fix the damage you have already done.  Start again and do this properly with a PKGBUILD.

zAo wrote:

I didn't know what I was doing

Then ask before you start flailing aimlessly moving things around and running commands as root.  Now anyone who wants to help you probably has to spend more time working around the damage you've done to yourself rather than just helping your through the relatively easy and proper way to reach your end goals.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2015-06-22 11:53:32

zAo
Member
Registered: 2012-11-01
Posts: 26

Re: pkg-config doesn't find libmfx

I did most of the compiling with my own userid, but after one attempt with root, the ownership of the files went messy. Thanks for the advice; I will try to start from scratch.

Any ideas why pkg-config doesn't detect the files?

@Lone_wolf: thanks. I don't see any Intel Media SDK in AUR? I copied the needed files from a install on a other machine (to /media/downloads/opensource/SDK/ as seen in the .pc)

Offline

#7 2015-06-22 12:14:10

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,026

Re: pkg-config doesn't find libmfx

Looking at the mfx_dispatch site, the intel media SDK may only be needed on windows while libva does the same job for linux.

First step is to create a package for mfx_dispatch .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#8 2015-06-22 12:24:05

zAo
Member
Registered: 2012-11-01
Posts: 26

Re: pkg-config doesn't find libmfx

Did a restart from scratch: removed all *mfx* files from /usr/*, removed all build files and downloaded them again. Apart from make install, everything is run as my desktop user.

[zao@nuc mfx_dispatch]$ mkdir build && cd build
[zao@nuc build]$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local
-- The C compiler identification is GNU 5.1.0
-- The CXX compiler identification is GNU 5.1.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Intel Media SDK is here: /media/downloads/git/mfx_dispatch
-- Configuring done
-- Generating done
-- Build files have been written to: /media/downloads/git/mfx_dispatch/build

Start build

[zao@nuc build]$ make -j
Scanning dependencies of target mfx
[  8%] [ 16%] [ 25%] [ 50%] [ 41%] [100%] [ 41%] [ 66%] [ 66%] [ 75%] [ 83%] [ 91%] Building CXX object CMakeFiles/mfx.dir/src/mfx_dxva2_device.cpp.o
Building CXX object CMakeFiles/mfx.dir/src/main.cpp.o
Building CXX object CMakeFiles/mfx.dir/src/mfx_library_iterator.cpp.o
Building CXX object CMakeFiles/mfx.dir/src/mfx_library_iterator_linux.cpp.o
Building CXX object CMakeFiles/mfx.dir/src/mfx_critical_section.cpp.o
Building CXX object CMakeFiles/mfx.dir/src/mfx_load_dll.cpp.o
Building CXX object CMakeFiles/mfx.dir/src/mfx_dispatcher_log.cpp.o
Building CXX object CMakeFiles/mfx.dir/src/mfx_function_table.cpp.o
Building CXX object CMakeFiles/mfx.dir/src/mfx_critical_section_linux.cpp.o
Building CXX object CMakeFiles/mfx.dir/src/mfx_load_dll_linux.cpp.o
Building CXX object CMakeFiles/mfx.dir/src/mfx_dispatcher.cpp.o
Building CXX object CMakeFiles/mfx.dir/src/mfx_win_reg_key.cpp.o
Linking CXX static library libmfx.a
[100%] Built target mfx

Install

[zao@nuc build]$ sudo make install
[100%] Built target mfx
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/include/mfxjpeg.h
-- Installing: /usr/local/include/mfxplugin++.h
-- Installing: /usr/local/include/mfxastructures.h
-- Installing: /usr/local/include/mfxla.h
-- Installing: /usr/local/include/mfxenc.h
-- Installing: /usr/local/include/mfxcommon.h
-- Installing: /usr/local/include/mfxplugin.h
-- Installing: /usr/local/include/mfxvp8.h
-- Installing: /usr/local/include/mfxdefs.h
-- Installing: /usr/local/include/mfxmvc.h
-- Installing: /usr/local/include/mfxstructures.h
-- Installing: /usr/local/include/mfxvideo.h
-- Installing: /usr/local/include/mfxvstructures.h
-- Installing: /usr/local/include/mfxaudio++.h
-- Installing: /usr/local/include/mfxpak.h
-- Installing: /usr/local/include/mfxvideo++.h
-- Installing: /usr/local/include/mfxaudio.h
-- Installing: /usr/local/include/mfxsession.h
-- Installing: /usr/local/lib/pkgconfig/libmfx.pc
-- Installing: /usr/local/lib/libmfx.a

pkg-config doesn’t find the right files:

[zao@nuc build]$ pkg-config --list-all| grep mfx
[zao@nuc build]$ echo $?
1

I know that building via PKGBUILD is much cleaner, but -for me- it add additional levels of complexity.

Any tips or ideas? Thanks for your patience smile

Offline

#9 2015-06-22 12:45:51

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,626
Website

Re: pkg-config doesn't find libmfx

If you can build manually you can make a PKGBUILD.  Really.  Do it.

But in either case, you'll either need to specify the DESTDIR for the install, or adjust pkg-config to look in /usr/local/...


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#10 2015-06-22 12:51:44

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,026

Re: pkg-config doesn't find libmfx

-- Installing: /usr/local/lib/pkgconfig/libmfx.pc

run pkg-config --variable pc_path pkg-config

on my system :

$ pkg-config --variable pc_path pkg-config
/usr/lib/pkgconfig:/usr/share/pkgconfig
~

If your system outputs the same,  that means pkg-config doesn't look in  /usr/local/lib/pkgconfig  .

Creating an mfx_dispatch package that installs all files in the correct locations is best solution, but if you still don't want to do that :

pkg-config supports several environment variables, check pkg-config manpage for details.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#11 2015-06-22 14:27:43

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,626
Website

Re: pkg-config doesn't find libmfx

zAo wrote:
[zao@nuc build]$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local

Sorry I missed this the first time - but you explicitly told it to install to /usr/local.  Why did you do that?  Do you want it in /usr/local?  If so, you need to configure pkg-config as described above.  I'd just install it normally to /usr/ instead - using a PKGBUILD.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#12 2015-06-22 14:28:48

zAo
Member
Registered: 2012-11-01
Posts: 26

Re: pkg-config doesn't find libmfx

Thanks Lone_Wolf. I rebuild for /usr/lib since my pc_path is the same:

[zao@nuc FFmpeg]$ pkg-config --variable pc_path pkg-config
/usr/lib/pkgconfig:/usr/share/pkgconfig
[zao@nuc FFmpeg]$ ls -l /usr/lib/pkgconfig/libmfx.pc
-rw-r--r-- 1 root root 330 Jun 22 14:13 /usr/lib/pkgconfig/libmfx.pc

Still no juice. I also tried with $PKG_CONFIG_LIBDIR and checked all the paths in /usr/lib/pkgconfig/libmfx.pc, but pkg-config still can't find it.

A build for /usr (used /usr/local since its in the read.me) couldn't be found.

Last edited by zAo (2015-06-22 14:31:09)

Offline

#13 2015-06-22 14:29:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,626
Website

Re: pkg-config doesn't find libmfx

What is the actual output from pkg-config commands after you have installed mfx to /usr/ ?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#14 2015-06-22 14:35:05

zAo
Member
Registered: 2012-11-01
Posts: 26

Re: pkg-config doesn't find libmfx

Trilby wrote:

What is the actual output from pkg-config commands after you have installed mfx to /usr/ ?

From make install you mean?

[zao@nuc build]$ sudo make install
[100%] Built target mfx
Install the project...
-- Install configuration: ""
-- Installing: /usr/include/mfxjpeg.h
-- Installing: /usr/include/mfxplugin++.h
-- Installing: /usr/include/mfxastructures.h
-- Installing: /usr/include/mfxla.h
-- Installing: /usr/include/mfxenc.h
-- Installing: /usr/include/mfxcommon.h
-- Installing: /usr/include/mfxplugin.h
-- Installing: /usr/include/mfxvp8.h
-- Installing: /usr/include/mfxdefs.h
-- Installing: /usr/include/mfxmvc.h
-- Installing: /usr/include/mfxstructures.h
-- Installing: /usr/include/mfxvideo.h
-- Installing: /usr/include/mfxvstructures.h
-- Installing: /usr/include/mfxaudio++.h
-- Installing: /usr/include/mfxpak.h
-- Installing: /usr/include/mfxvideo++.h
-- Installing: /usr/include/mfxaudio.h
-- Installing: /usr/include/mfxsession.h
-- Installing: /usr/lib/pkgconfig/libmfx.pc
-- Installing: /usr/lib/libmfx.a

The .pc points to those same locations:

[zao@nuc FFmpeg]$ cat /usr/lib/pkgconfig/libmfx.pc
prefix=/usr
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include

Name: libmfx
Description: Intel Media SDK Dispatched static library
Version: 2013
Requires:
Requires.private:
Conflicts:
Libs: -L${libdir} -lsupc++ ${libdir}/libmfx.a
Libs.private:
Cflags: -I${includedir} -I/media/downloads/git/mfx_dispatch

Last edited by zAo (2015-06-22 14:36:52)

Offline

#15 2015-06-22 14:40:25

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,626
Website

Re: pkg-config doesn't find libmfx

No, I mean what I said.  What is the actual output from the pkg-config command after you've installed properly?  I just installed mfx using a PKGBUILD, and it works fine:

$ pkg-config --cflags libmfx
-I/tmp/mfx/src/mfx 

$ pkg-config --libs libmfx                                                                                                                                                            
-lsupc++ /usr/lib/libmfx.a

"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#16 2015-06-22 15:12:53

zAo
Member
Registered: 2012-11-01
Posts: 26

Re: pkg-config doesn't find libmfx

Thanks. It seems to be fine:

[zao@nuc FFmpeg]$ pkg-config --libs libmfx
-lsupc++ /usr/lib/libmfx.a
[zao@nuc FFmpeg]$  pkg-config --cflags libmfx
-I/media/downloads/git/mfx_dispatch

Are you willing to share your PKGBUILD?

Does your pkg-config --list-all| grep mfx show mfx?

Thanks again!

Last edited by zAo (2015-06-22 15:23:16)

Offline

#17 2015-06-22 18:55:14

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,626
Website

Re: pkg-config doesn't find libmfx

Here it is, but it is not quite ready to go to the AUR - so if you chose to submit it, be sure to read up a bit on that.  But it works well enough for local use:

_gitname="mfx"
pkgname="${_gitname}-git"
pkgver=0.18.e1594a0
pkgrel=1
pkgdesc=""
url=""
arch=('x86_64' 'i686')
license=('custom')
makedepends=('cmake' 'git')
source=("${_gitname}::git+https://github.com/lu-zero/mfx_dispatch.git")
sha256sums=('SKIP')

pkgver() {
        cd "${srcdir}/${_gitname}";
        echo "0.$(git rev-list --count HEAD).$(git describe --always )"
}

build() {
        cd "${srcdir}/${_gitname}";
        cmake -DCMAKE_INSTALL_PREFIX=/usr
        make
}

package() {
        cd "${srcdir}/${_gitname}";
        install -Dm644 COPYING "${pkgdir}/usr/share/licenses/mfx-git/COPYING"
        make PREFIX=/usr DESTDIR="${pkgdir}" install
}

And, yes, mfx is shown in the list output.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#18 2015-06-25 14:06:56

zAo
Member
Registered: 2012-11-01
Posts: 26

Re: pkg-config doesn't find libmfx

Thanks again Lone_Wolf. For future users wondering:
In the ffmpeg config.log there was a hint:

gcc: warning: /usr/lib/libmfx.a: linker input file unused because linking not done
gcc -Wl,-O1,--sort-common,--as-needed,-z,relro -Wl,--as-needed -Wl,-z,noexecstack -I/media/downloads/pkg/mfx-git/src/mfx /usr/lib/libmfx.a -o /tmp/ffconf.cbRsRzcG /tmp/ffconf.8BdWlwFh.o -lsupc++ -lgsm -lfreetype -lfontconfig -lfreetype -lcaca -lbluray -lass -lgnutls -ldl -lm -llzma -lbz2 -lz -pthread
ERROR: libmfx not found using pkg-config

It was due to the use of a wrong Intel Media SDK . After installing the correct one (2015R2) and linking the 'include' directory to mfx_dispatch/mfx, ffmpeg compiled. (more here: https://github.com/lu-zero/mfx_dispatch/issues/4)

The problem now is that, if you start ffmpeg with h264_qsv, it cannot initiate a MFX session, but I don't know why or how to approach that.

I give up for now.

Offline

#19 2015-07-04 06:25:52

Naoya
Member
Registered: 2015-07-04
Posts: 1

Re: pkg-config doesn't find libmfx

The must satisfy the following conditions for using QSV.

- Install the Intel Media SDK.
- Meet the hardware specifications required by the Media SDK(Haswell core i3 is lowest)
- Apply patch included in the Intel Media SDK to the kernel.
- Apply patch included in the Intel Media SDK to the libdrm.
- Apply patch included in the Intel Media SDK to the libva.
- You must use the iHD (intel proprietary version, not i965) as VAAPI driver.

Even If meets all the conditions, it will not work.
Because libmfx on linux has serval issues.
http://stackoverflow.com/questions/2991 … red-object
https://github.com/lu-zero/mfx_dispatch/issues/11

Thanks.

Offline

Board footer

Powered by FluxBB