Giter VIP home page Giter VIP logo

mfx_dispatch's Introduction

Autotooled version of the opensource Intel media sdk dispatcher.

LICENSE

Linux

Requirements

  • A C/C++ compiler
  • autotools
  • libva

Building

autoreconf -i
./configure --prefix=/usr
make -j$(nproc)
make install

Windows

The dispatcher provided by Intel only works on MS visual studio builds due the fact it is written in C++ and mingw64 isn't ABI and library compatible. This set of build systems let you easily build a mingw-w64 one.

Requirements

  • MediaSDK drivers from Intel
  • mingw-w64 toolchain
  • autotools or cmake (pick your poison)

Building using autotools

Cross compile

autoreconf -i
./configure --host=x86_64-w64-mingw32
make -j$(nproc)
make install DESTDIR=/usr/x86_64-w64-mingw32

Building on a native mingw-w64 environment

autoreconf -i
./configure --prefix=/mingw64
make -j$(nproc) install

NOTE: Make sure you set the prefix to the correct one for your environment otherwise it will fail to link.

mfx_dispatch's People

Contributors

1480c1 avatar brainiarc7 avatar btbn avatar chouquette avatar corristo avatar deadsix27 avatar elenril avatar elthariel avatar galinart avatar ismail avatar johanneskauffmann avatar kloczek avatar lekma avatar lu-zero avatar maximd33 avatar maximd33i avatar mstorsjo avatar nyanmisaka avatar rathann avatar reitowo avatar robux4 avatar sibras avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mfx_dispatch's Issues

no release for 1.25

It looks like the code was updated to match 1.25 version in 613c5c7 but there's no corresponding release. Could you make one?

'swscanf_s' was not declared in this scope

Building with x86_64-w64-mingw32.static-g++ is failing for me as of a7d95e5

[02:17:07][Step 1/1] src/mfx_plugin_hive.cpp: In constructor 'MFX::MFXPluginsInFS::MFXPluginsInFS(mfxVersion)':
[02:17:07][Step 1/1] src/mfx_plugin_hive.cpp:293:88: error: 'swscanf_s' was not declared in this scope
[02:17:07][Step 1/1]              if (1 != swscanf_s(find_data.cFileName + charsPermfxU8 * i, L"%2x", &hexNum))
[02:17:07][Step 1/1]                                                                                         ^
[02:17:07][Step 1/1] src/mfx_plugin_hive.cpp: In member function 'bool MFX::MFXPluginsInFS::ParseKVPair(msdk_disp_char*, msdk_disp_char*, MFX::PluginDescriptionRecord&)':
[02:17:07][Step 1/1] src/mfx_plugin_hive.cpp:399:50: error: 'swscanf_s' was not declared in this scope
[02:17:07][Step 1/1]          if (0 == swscanf_s(value, L"%d", &version))
[02:17:07][Step 1/1]                                                   ^
[02:17:07][Step 1/1] src/mfx_plugin_hive.cpp:419:53: error: 'swscanf_s' was not declared in this scope
[02:17:07][Step 1/1]          if (0 == swscanf_s(value, L"%d", &APIversion))

QuickSync not working in ffmpeg and libav

Hi @lu-zero

I've run in to a couple of potential problems with:

I have only seen these issues on my Intel J1900 CPU, my Intel i7-4770 does not have these problems. It's tempting just to blame my hardware, but I have done similar tests with Handbrake and q264 and they are not affected by either of these issues...

Issue 1 - jumpy output

Take a look at these two example files:

Original: http://data.purplepixelmedia.co.uk/30seconds.mp4
QSV encoded: http://data.purplepixelmedia.co.uk/30seconds-qsv_out.mp4

You can see in the original that the frame numbers should count up sequentially, but in the qsv output, the time 'jumps' around. The command I ran to create the qsv encoded version was:
ffmpeg -i 30seconds.mp4 -map 0:0 -b:v 1000K -c:v h264_qsv 30seconds-qsv_out.mp4

Interestingly, if I resize the video to 1280x720 then the output is fine (but noticeably slower) - the command for this was
ffmpeg -i 30seconds.mp4 -map 0:0 -s 1280x720 -b:v 1000K -c:v h264_qsv 30seconds-qsv_out720p.mp4

I have tied other clips which are 1280x720 to start with, but if I don't resize them, then I get the same 'jumping' problem. It seems that by forcing ffmpeg to do some processing that this fixes the jumping problem, but if the video is not resized, then it does not work properly.

Going through the output.mp4 frame-by-frame you can see that it always skips back exactly 4 frames, but at seemingly random times through the video. I'm not sure if this 4 frame jump gives any clues as to what might be going wrong?

Issue 2 - not working after driver update

I hoped I might be able to fix the issue by updating my driver, but unfortunately this stopped ffmpeg and libav working entirely when trying to use QuickSync. The encoder just sits there and doesn't actually encode anything (I need to use CTRL+C to abort and return to the command prompt).

  • Driver: 10.18.10.3408 (20/01/2014) - Working (but with the jumpy encoding mentioned above)
  • Driver: 10.18.10.3958 (30/09/2014) - Not working

I'd be happy to put this down to a driver issue, but as I mentioned above, Handbrake and q264 both continue to work perfectly with QuickSync.

Any idea what could be going wrong?

How to install in order to compile ffmpeg using mingW32

Hi to all
I'm a little new so I apologize if my question seems stupid....
I download the package under Windows XP and compiled it using Visual Studio 2010.
Now I have the libmfx_d.lib. How can I install in mingw ?
Should I copy the file libmfx.pc into directory c:\MingW\lib\pkgconfig ?
In the c:\MingW\lib directory all libraries have a ".a" extension and shouldn't be compatible
with the ".lib" generated by VS2010.
Regards

[Linux]:loading vaapi driver is wrong

Loading vaapi driver for Intel is wrong.
NG: i965.so
OK: iHD.so

If using the mfx_dispatch provided in the MSDK package, there has no problem.

Sample code:

int main(int argc, char **argv)
{
    mfxStatus sts = MFX_ERR_NONE;
    mfxSession session;
    mfxVersion version;

    version.Minor = 0;
    version.Major = 1;

    sts = MFXInit(MFX_IMPL_HARDWARE, &version, &session);

    if (sts != MFX_ERR_NONE) {
        printf("MFXInit error %x\n", sts);
        return sts;
    }

    sts = mfx_sethandle(&session);
    if (sts != MFX_ERR_NONE) {
        printf("sethandle error %x\n", sts);
        return sts;
    }
    return 0;
}

MSDK result:

$ ./a.out
libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0


lu-zero mfx_dispath result:

$ ./a.out
libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 1
libva error: va_getDriverName() failed with operation failed,driver_name=i965


How to compiling as shared library?

I need the famous libmfx-0.dll shared library, how to compile it as shared library?

Because using the following configuring option doesn't work :

./configure --host=x86_64-w64-mingw32 --enable-shared --disable-static
make: Nothing to be done for 'all'.

No video with ffplay and mediasdk 2015rc6

I compiled mfx_dispatch and installed mediasdk 2015rc6 (community version) on Linux. Everything configured and when I try to "ffplay -vcodec h264_qsv..." it doesn't show the video (it just plays the audio).

I'm using it on Linux with ffmpeg 2.8. My question is: I imagine it can't work with Sandy Bridge, right? At least the mediasdk says I need at least a Haswell. Is this the problem or is there some workaround to make it work on Sandy Bridge too?

Ps: just for comparison, gst-play (from gstreamer) can use libva and hardware accelerate the video decoding, so I suppose mediasdk is important just for the encoding, but not the decoding, since it could be done with libva alone, right?

can not run in windows xp

_wfopen_s can not be call in windows xp. _wfopen_s is called in mfx_plugin_hive.cpp . use _wfopen instead in windows xp

Broken MinGW compilation with two last commits

Compilation log from make

$ make -j 2
depbase=`echo src/main.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ./libtool  --tag=CXX   --mode=compile g++ -DPACKAGE_NAME=\"libmfx\" -DPACKAGE_TARNAME=\"libmfx\" -DPACKAGE_VERSION=\"1.16\" -DPACKAGE_STRING=\"libmfx\ 1.16\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libmfx\" -DVERSION=\"1.16\" -DMFX_HAVE_WINDOWS=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I.  -I./include -DMINGW_HAS_SECURE_API=1 -I/local32/include -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1  -I/local32/include -mms-bitfields -mthreads -mtune=generic -pipe -MT src/main.lo -MD -MP -MF $depbase.Tpo -c -o src/main.lo src/main.cpp &&\
mv -f $depbase.Tpo $depbase.Plo
depbase=`echo src/mfx_critical_section.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ./libtool  --tag=CXX   --mode=compile g++ -DPACKAGE_NAME=\"libmfx\" -DPACKAGE_TARNAME=\"libmfx\" -DPACKAGE_VERSION=\"1.16\" -DPACKAGE_STRING=\"libmfx\ 1.16\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libmfx\" -DVERSION=\"1.16\" -DMFX_HAVE_WINDOWS=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I.  -I./include -DMINGW_HAS_SECURE_API=1 -I/local32/include -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1  -I/local32/include -mms-bitfields -mthreads -mtune=generic -pipe -MT src/mfx_critical_section.lo -MD -MP -MF $depbase.Tpo -c -o src/mfx_critical_section.lo src/mfx_critical_section.cpp &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  g++ -DPACKAGE_NAME=\"libmfx\" -DPACKAGE_TARNAME=\"libmfx\" -DPACKAGE_VERSION=\"1.16\" "-DPACKAGE_STRING=\"libmfx 1.16\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libmfx\" -DVERSION=\"1.16\" -DMFX_HAVE_WINDOWS=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -I./include -DMINGW_HAS_SECURE_API=1 -I/local32/include -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -I/local32/include -mms-bitfields -mthreads -mtune=generic -pipe -MT src/main.lo -MD -MP -MF src/.deps/main.Tpo -c src/main.cpp -o src/main.o
libtool: compile:  g++ -DPACKAGE_NAME=\"libmfx\" -DPACKAGE_TARNAME=\"libmfx\" -DPACKAGE_VERSION=\"1.16\" "-DPACKAGE_STRING=\"libmfx 1.16\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libmfx\" -DVERSION=\"1.16\" -DMFX_HAVE_WINDOWS=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -I./include -DMINGW_HAS_SECURE_API=1 -I/local32/include -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -I/local32/include -mms-bitfields -mthreads -mtune=generic -pipe -MT src/mfx_critical_section.lo -MD -MP -MF src/.deps/mfx_critical_section.Tpo -c src/mfx_critical_section.cpp -o src/mfx_critical_section.o
src/main.cpp: In function 'mfxStatus MFXVideoCORE_SetHandle(mfxSession, mfxHandleType, mfxHDL)':
src/main.cpp:915:22: error: 'struct MFX_DISP_HANDLE' has no member named 'got_user_hwctx'
             pHandle->got_user_hwctx = 1;
                      ^
Makefile:639: recipe for target 'src/main.lo' failed
make: *** [src/main.lo] Error 1
make: *** Waiting for unfinished jobs....
depbase=`echo src/main.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ./libtool  --tag=CXX   --mode=compile g++ -DPACKAGE_NAME=\"libmfx\" -DPACKAGE_TARNAME=\"libmfx\" -DPACKAGE_VERSION=\"1.16\" -DPACKAGE_STRING=\"libmfx\ 1.16\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libmfx\" -DVERSION=\"1.16\" -DMFX_HAVE_WINDOWS=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I.  -I./include -DMINGW_HAS_SECURE_API=1 -I/local32/include -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1  -I/local32/include -mms-bitfields -mthreads -mtune=generic -pipe -MT src/main.lo -MD -MP -MF $depbase.Tpo -c -o src/main.lo src/main.cpp &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  g++ -DPACKAGE_NAME=\"libmfx\" -DPACKAGE_TARNAME=\"libmfx\" -DPACKAGE_VERSION=\"1.16\" "-DPACKAGE_STRING=\"libmfx 1.16\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libmfx\" -DVERSION=\"1.16\" -DMFX_HAVE_WINDOWS=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -I./include -DMINGW_HAS_SECURE_API=1 -I/local32/include -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -I/local32/include -mms-bitfields -mthreads -mtune=generic -pipe -MT src/main.lo -MD -MP -MF src/.deps/main.Tpo -c src/main.cpp -o src/main.o
src/main.cpp: In function 'mfxStatus MFXVideoCORE_SetHandle(mfxSession, mfxHandleType, mfxHDL)':
src/main.cpp:915:22: error: 'struct MFX_DISP_HANDLE' has no member named 'got_user_hwctx'
             pHandle->got_user_hwctx = 1;
                      ^
Makefile:639: recipe for target 'src/main.lo' failed
make: *** [src/main.lo] Error 1

src/main.cpp:21:10: fatal error: windows.h: No such file or directory

sudo apt-get install -y libva-dev vainfo
git clone --depth=1 https://github.com/lu-zero/mfx_dispatch.git
cd mfx_dispatch
autoreconf -i                           
./configure --prefix=/usr
make -j$(nproc)

It fails with the following error:

src/main.cpp:21:10: fatal error: windows.h: No such file or directory
 #include <windows.h>
          ^~~~~~~~~~~
compilation terminated.
Makefile:702: recipe for target 'src/libmfx_la-main.lo' failed
make: *** [src/libmfx_la-main.lo] Error 1

VA Initialization dropped

Hi, I notice that in @maximd33 last commit to update to 1.27 that the code to initialize VA for linux got dropped. Specifically all the internal_hwctx stuff is gone. Was that intentional? HandBrake recently updated to your latest and coincidentally I happened to try building HandBrake on Linux with QSV enabled for the first time and discovered this. I've already created a patch on our side that resolves it by initializing VA and calling SetHandle, but just wanted to check if this was an intentional change in behavior.

Is the Intel SDK really required?

This might be a silly question, but is the Intel SDK actually required to be installed on the computer which you are using to build libmfx?

I have tried building libmfx on Windows in MinGW and it seems to build just fine without the Intel SDK ever being installed. The files generated are libmfx.a (254KB) and libmfx.la (1KB).

Does this sound correct to you? Using this build (without the SDK) I was able to compile ffmpeg + qsv

(confused!)

[Linux]undefined reference to `MFX::SelectImplementationType

compile the mfx_dispatch for the ffmpeg
autoreconf -i`
./configure --prefix=/usr/ --libdir=/usr/lib64
make;make install

when configure the ffmpeg source code with

./confgiure --enable-libmfx;the config.log bellow

check_pkg_config libmfx mfx/mfxvideo.h MFXInit
pkg-config --exists --print-errors libmfx
check_func_headers mfx/mfxvideo.h MFXInit -lmfx -lstdc++ -lva-drm -lva-x11 -lva
check_ld cc -lmfx -lstdc++ -lva-drm -lva-x11 -lva
check_cc
BEGIN /tmp/ffconf.G1Df1vFA.c
1 #include <mfx/mfxvideo.h>
2 long check_MFXInit(void) { return (long) MFXInit; }
3 int main(void) { return 0; }
END /tmp/ffconf.G1Df1vFA.c
gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -std=c99 -fomit-frame-pointer -pthread -c -o /tmp/ffconf.hy5b3DdR.o /tmp/ffconf.G1Df1vFA.c
gcc -Wl,--as-needed -Wl,-z,noexecstack -o /tmp/ffconf.0PLCgiqR /tmp/ffconf.hy5b3DdR.o -lmfx -lstdc++ -lva-drm -lva-x11 -lva -lm -lz -pthread
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/libmfx.so: undefined reference to `MFX::SelectImplementationType(unsigned int, int_, unsigned int_, unsigned int*)'
collect2: error: ld returned 1 exit status
ERROR: libmfx not found using pkg-config

Can not compile with gcc 5.2

Hello,
since a time we use your lib in our msys2 build script ( https://github.com/jb-alvarado/media-autobuild_suite ). But now msys2 have change to gcc 5.2 and since this time we are not able anymore to compile mfx.

Here is the error message:

[...]
libtool: compile:  g++ -DPACKAGE_NAME=\"libmfx\" -DPACKAGE_TARNAME=\"libmfx\" -DPACKAGE_VERSION=\"1.16\" "-DPACKAGE_STRING=\"libmfx 1.16\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libmfx\" -DVERSION=\"1.16\" -DMFX_HAVE_WINDOWS=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -I./include -DMINGW_HAS_SECURE_API=1 -I/local32/include -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -I/local32/include -mms-bitfields -mthreads -mtune=generic -pipe -MT src/main.lo -MD -MP -MF src/.deps/main.Tpo -c src/main.cpp -o src/main.o
In file included from D:/_System/msys2-64_Juni2015/msys64/mingw32/i686-w64-mingw32/include/stdio.h:991:0,
                 from src/mfx_plugin_hive.h:39,
                 from src/mfx_load_plugin.h:34,
                 from src/mfx_dispatcher.h:39,
                 from src/main.cpp:31:
D:/_System/msys2-64_Juni2015/msys64/mingw32/i686-w64-mingw32/include/sec_api/stdio_s.h:32:51: error: conflicting declaration of 'int sscanf(const char*, const char*, ...)' with 'C' linkage
   int __cdecl sscanf_s(const char*,const char*,...);
                                                   ^
In file included from src/mfx_plugin_hive.h:39:0,
                 from src/mfx_load_plugin.h:34,
                 from src/mfx_dispatcher.h:39,
                 from src/main.cpp:31:
D:/_System/msys2-64_Juni2015/msys64/mingw32/i686-w64-mingw32/include/stdio.h:227:5: note: previous declaration with 'C++' linkage
 int sscanf(const char *__source, const char *__format, ...)
     ^
Makefile:637: die Regel für Ziel „src/main.lo“ scheiterte
make: *** [src/main.lo] Fehler 1

Is there something what we can do, or needs this a change in your code?

Regards
Jonathan

Compiled Failed

Compiled under mingw32 and no dll file make after make install,only header files.

mfxplugin.h: No such file or directory

Hi

I try compile mfx_dispatch
I was create symlink /usr/x86_64-w64-mingw32/mfx on SDK include. There is output:
ls /usr/x86_64-w64-mingw32/mfx
mfxastructures.h mfxaudio++.h mfxdefs.h mfxjpeg.h mfxmvc.h mfxplugin++.h mfxstructures.h mfxvideo++.h
mfxaudio.h mfxcommon.h mfxenc.h mfxla.h mfxplugin.h mfxsession.h mfxvideo.h mfxvstructures.h

When I try compile, I get error:

libtool: compile: x86_64-w64-mingw32-g++ -DPACKAGE_NAME="libmfx" -DPACKAGE_TARNAME="libmfx" -DPACKAGE_VERSION="1.7" "-DPACKAGE_STRING="libmfx 1.7"" -DPACKAGE_BUGREPORT="" -DPACKAGE_URL="" -DPACKAGE="libmfx" -DVERSION="1.7" -DMFX_HAVE_WINDOWS=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=".libs/" -I. -I./include -DMINGW_HAS_SECURE_API=1 -g -O2 -MT mfx_dispatcher_log.lo -MD -MP -MF .deps/mfx_dispatcher_log.Tpo -c src/mfx_dispatcher_log.cpp -o mfx_dispatcher_log.o >/dev/null 2>&1
mv -f .deps/mfx_plugin_cfg_parser.Tpo .deps/mfx_plugin_cfg_parser.Plo
mv -f .deps/mfx_dispatcher_log.Tpo .deps/mfx_dispatcher_log.Plo
In file included from src/mfx_plugin_hive.h:35:0,
from src/mfx_load_plugin.h:34,
from src/mfx_dispatcher.h:39,
from src/mfx_dispatcher.cpp:31:
src/mfx_win_reg_key.h:37:23: fatal error: mfxplugin.h: No such file or directory
#include "mfxplugin.h"
^
compilation terminated.
In file included from src/mfx_library_iterator.h:36:0,
from src/mfx_library_iterator.cpp:33:
src/mfx_win_reg_key.h:37:23: fatal error: mfxplugin.h: No such file or directory
#include "mfxplugin.h"
^
compilation terminated.
In file included from src/mfx_win_reg_key.cpp:33:0:
src/mfx_win_reg_key.h:37:23: fatal error: mfxplugin.h: No such file or directory
#include "mfxplugin.h"
^
compilation terminated.
In file included from src/mfx_plugin_hive.h:35:0,
from src/mfx_load_plugin.h:34,
from src/mfx_load_plugin.cpp:31:
src/mfx_win_reg_key.h:37:23: fatal error: mfxplugin.h: No such file or directory
#include "mfxplugin.h"
^
compilation terminated.
In file included from src/mfx_plugin_hive.h:35:0,
from src/mfx_load_plugin.h:34,
from src/mfx_dispatcher.h:39,
from src/main.cpp:34:
src/mfx_win_reg_key.h:37:23: fatal error: mfxplugin.h: No such file or directory
#include "mfxplugin.h"
^
compilation terminated.
In file included from src/mfx_plugin_hive.h:35:0,
from src/mfx_load_plugin.h:34,
from src/mfx_dispatcher.h:39,
from src/mfx_function_table.cpp:31:
src/mfx_win_reg_key.h:37:23: fatal error: mfxplugin.h: No such file or directory
#include "mfxplugin.h"
^
compilation terminated.
In file included from src/mfx_dxva2_device.cpp:37:0:
src/mfx_dxva2_device.h:38:21: fatal error: mfxdefs.h: No such file or directory
#include <mfxdefs.h>
^
compilation terminated.
In file included from src/mfx_plugin_hive.h:35:0,
from src/mfx_load_plugin.h:34,
from src/mfx_dispatcher.h:39,
from src/mfx_load_dll.cpp:33:
src/mfx_win_reg_key.h:37:23: fatal error: mfxplugin.h: No such file or directory
#include "mfxplugin.h"
^
compilation terminated.
libtool: compile: x86_64-w64-mingw32-g++ -DPACKAGE_NAME="libmfx" -DPACKAGE_TARNAME="libmfx" -DPACKAGE_VERSION="1.7" "-DPACKAGE_STRING="libmfx 1.7"" -DPACKAGE_BUGREPORT="" -DPACKAGE_URL="" -DPACKAGE="libmfx" -DVERSION="1.7" -DMFX_HAVE_WINDOWS=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=".libs/" -I. -I./include -DMINGW_HAS_SECURE_API=1 -g -O2 -MT mfx_critical_section.lo -MD -MP -MF .deps/mfx_critical_section.Tpo -c src/mfx_critical_section.cpp -o mfx_critical_section.o >/dev/null 2>&1
make: *** [mfx_library_iterator.lo] Error 1
make: *** Waiting for unfinished jobs....
make: *** [main.lo] Error 1
make: *** [mfx_load_plugin.lo] Error 1
make: *** [mfx_win_reg_key.lo] Error 1
make: *** [mfx_function_table.lo] Error 1
make: *** [mfx_dispatcher.lo] Error 1
make: *** [mfx_load_dll.lo] Error 1
make: *** [mfx_dxva2_device.lo] Error 1
mv -f .deps/mfx_critical_section.Tpo .deps/mfx_critical_section.Plo

Where I miss?

Provide releases in the form of tags

Currently, there's only really a master branch and it's hard to package against Git commit hash ids. Can you please tag significant releases?

Even if you're not following upstream's tag model (I think latest upstream is 1.6.0), just giving SemVer tag names would be very helpful.

Compile error in mfx_plugin_hive_linux.cpp

I'm getting the following error in mfx_plugin_hive_linux.cpp when trying to compile libmfx:

src/mfx_plugin_hive_linux.cpp:38:35: fatal error: mfx_plugin_cfg_parser.h: No such file or directory
 #include "mfx_plugin_cfg_parser.h"
                                   ^
compilation terminated.
make: *** [Makefile:763: src/libmfx_la-mfx_plugin_hive_linux.lo] Error 1

This error is caused by the recent git commits from October 9, 2016. It was compiling well before these commits.

Commands used:

$ git clone https://github.com/lu-zero/mfx_dispatch.git libmfx-git
$ cd libmfx-git
$ autoreconf -i
$ ./configure \
                --prefix=/usr \
                --enable-static=yes \
                --enable-shared=no \
                --enable-fast-install=yes \
                --with-libva_drm=yes \
                --with-libva_x11=yes \
                --with-pic
$ make -j1

System information (version):
OS: Arch Linux x86_64
libmfx: git master (currently at r42.f9e3baa)
GCC: 6.2.1
glibc: 2.24
libva: 1.7.2
CPU: Intel Haswell

Any help or comment would be appreciated.
Thank you.

struct VADriverContext' has no member named 'drm_state'

root@qsv:/mfx_dispatch# git clone https://github.com/lu-zero/mfx_dispatch.git
root@qsv:
/mfx_dispatch# mv mfx/ mfx_old
root@qsv:/mfx_dispatch# ln -s /opt/intel/mediasdk/include/ /root/mfx_dispatch/mfx
root@qsv:
/mfx_dispatch# autoreconf -i
root@qsv:/mfx_dispatch# ./configure --prefix=/usr/local
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for LIBVA_DRM... yes
checking for LIBVA_X11... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking how to print strings... printf
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @file support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
configure: creating ./config.status
config.status: creating libmfx.pc
config.status: creating Makefile
config.status: executing depfiles commands
config.status: executing libtool commands
root@qsv:
/mfx_dispatch# make -j
depbase=echo src/mfx_va_glue.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||';
/bin/bash ./libtool --tag=CC --mode=compile gcc -DPACKAGE_NAME="libmfx" -DPACKAGE_TARNAME="libmfx" -DPACKAGE_VERSION="1.7" -DPACKAGE_STRING="libmfx\ 1.7" -DPACKAGE_BUGREPORT="" -DPACKAGE_URL="" -DPACKAGE="libmfx" -DVERSION="1.7" -DMFX_HAVE_LINUX=1 -DHAVE_LIBVA_DRM=1 -DHAVE_LIBVA_X11=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=".libs/" -I. -I./include -DMINGW_HAS_SECURE_API=1 -g -O2 -MT src/mfx_va_glue.lo -MD -MP -MF $depbase.Tpo -c -o src/mfx_va_glue.lo src/mfx_va_glue.c &&
mv -f $depbase.Tpo $depbase.Plo
libtool: compile: gcc -DPACKAGE_NAME="libmfx" -DPACKAGE_TARNAME="libmfx" -DPACKAGE_VERSION="1.7" "-DPACKAGE_STRING="libmfx 1.7"" -DPACKAGE_BUGREPORT="" -DPACKAGE_URL="" -DPACKAGE="libmfx" -DVERSION="1.7" -DMFX_HAVE_LINUX=1 -DHAVE_LIBVA_DRM=1 -DHAVE_LIBVA_X11=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=".libs/" -I. -I./include -DMINGW_HAS_SECURE_API=1 -g -O2 -MT src/mfx_va_glue.lo -MD -MP -MF src/.deps/mfx_va_glue.Tpo -c src/mfx_va_glue.c -fPIC -DPIC -o src/.libs/mfx_va_glue.o
src/mfx_va_glue.c: In function 'mfx_deallocate_va':
src/mfx_va_glue.c:80:19: error: 'struct VADriverContext' has no member named 'drm_state'
make: *** [src/mfx_va_glue.lo] Error 1

whats a problem?

1.23 breaks ABI without bumping SO version

Unfortunately, some structures changed sizes, which constitutes ABI change and will break applications linked against the old version (1.21) if the shared library is updated underneath without rebuilding. Here's the ABI change analysis done using libabigail:

$ abipkgdiff --d1 libmfx-debuginfo-1.21-1.fc27.x86_64.rpm --d2 libmfx-debuginfo-1.23-1.fc27.x86_64.rpm --devel1 libmfx-devel-1.21-1.fc27.x86_64.rpm --devel2 libmfx-devel-1.23-1.fc27.x86_64.rpm libmfx-1.21-1.fc27.x86_64.rpm libmfx-1.23-1.fc27.x86_64.rpm 
================ changes of 'libmfx.so.0.0.0'===============
  Functions changes summary: 0 Removed, 1 Changed, 0 Added function
  Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

  1 function with some indirect sub-type change:

    [C]'function mfxStatus MFXVideoPAK_ProcessFrameAsync(mfxSession, mfxPAKInput*, mfxPAKOutput*, mfxSyncPoint*)' at mfx_exposed_functions_list.h:133:1 has some indirect sub-type changes:
      parameter 2 of type 'mfxPAKInput*' has sub-type changes:
        in pointed to type 'typedef mfxPAKInput' at mfxpak.h:55:1:
          underlying type 'struct __anonymous_struct__' at mfxpak.h:40:1 changed:
            type size changed from 1472 to 1088 bits
            2 data member insertions:
              'mfxU16 __anonymous_struct__::NumPayload', at offset 960 (in bits) at mfxpak.h:53:1
              'mfxPayload** __anonymous_struct__::Payload', at offset 1024 (in bits) at mfxpak.h:54:1
            8 data member changes:
             type of 'mfxU32 __anonymous_struct__::reserved[32]' changed:
               array element type 'typedef mfxU32' changed: 
                 underlying type 'unsigned int' changed:
                   type name changed from 'unsigned int' to 'unsigned short int'
                   type size changed from 32 to 16 bits
               type name changed from 'mfxU32[32]' to 'mfxU16[32]'
               array type size changed from 1024 to 512 bits:

             'mfxFrameSurface1* __anonymous_struct__::InSurface' offset changed from 1024 to 512 (in bits)
             'mfxU16 __anonymous_struct__::NumFrameL0' offset changed from 1088 to 576 (in bits)
             'mfxFrameSurface1** __anonymous_struct__::L0Surface' offset changed from 1152 to 640 (in bits)
             'mfxU16 __anonymous_struct__::NumFrameL1' offset changed from 1216 to 704 (in bits)
             'mfxFrameSurface1** __anonymous_struct__::L1Surface' offset changed from 1280 to 768 (in bits)
             'mfxU16 __anonymous_struct__::NumExtParam' offset changed from 1344 to 832 (in bits)
             'mfxExtBuffer** __anonymous_struct__::ExtParam' offset changed from 1408 to 896 (in bits)
      parameter 3 of type 'mfxPAKOutput*' has sub-type changes:
        in pointed to type 'typedef mfxPAKOutput' at mfxpak.h:66:1:
          underlying type 'struct __anonymous_struct__' at mfxpak.h:57:1 changed:
            type size changed from 256 to 768 bits
            1 data member insertion:
              'mfxU16 __anonymous_struct__::reserved[32]', at offset 0 (in bits) at mfxpak.h:58:1
            4 data member changes:
             'mfxBitstream* __anonymous_struct__::Bs' offset changed from 0 to 512 (in bits)
             'mfxFrameSurface1* __anonymous_struct__::OutSurface' offset changed from 64 to 576 (in bits)
             'mfxU16 __anonymous_struct__::NumExtParam' offset changed from 128 to 640 (in bits)
             'mfxExtBuffer** __anonymous_struct__::ExtParam' offset changed from 192 to 704 (in bits)


================ end of changes of 'libmfx.so.0.0.0'===============

ubuntu 15.10 intel graphics stack and ffmpeg

Hello!
just trying to firgure out if mfx_dispatch works with the current intel graphics stack for Ubuntu 15.10 and ffmpeg 2.8. I can't really find the actual requirements. Everything compiles correctly but I get an Error trying to encode a sample Video:
Error initializing an internal MFX session
So I need to install the libva and libdrm from the current Intel Media Server Studio or did I missed some configs for getting everything stick together? I would prefer not to change my current Kernel for qsv hardware accleration.

Special underlying context support

The linux/va-api has some experiment to hide the setup code inside the dispatcher, so far at least for the Intel-provided examples it works.

x86 vs x64 APIENTRY?

Compiling for x86/i686 UWP/Windows Store. Library which is statically linked fails to load intel_gfx_api-x86.dll, with Entry Point Not Found. This is because intel_gfx_api-x86.dll (on my machine) exports _InitialiseMediaSession and _DisposeMediaSession, but libmfx.a imports _InitialiseMediaSession@12 and _DisposeMediaSession@4.

It works fine on x64, since the APIENTRY modifiers in intel_api_factory.h are ignored on x64.

Now I managed to hack around this by patching intel_gfx_api-x86.def, removing the name decorations, and by patching intel_api_factory.h by removing the APIENTRY modifiers.

But would that be the right solution? Is it an Intel problem that the x86 dll exports non-decorated function names (meaning no @12 or @4 appended)? Should this library be modified to match the dll? Or should Intel update their dll's? Looking through other x86 system dll's, it seems none of them have these name decorations in their export table.

My machine with Intel Xe Graphics, and my buddies machine with an Intel UHD630, both have the x86 dll which exports the non-decorated names.

Edit: this is what I changed to make it work:

diff --git a/src/intel_api_factory.h b/src/intel_api_factory.h
index 0be5dcb..29e9773 100644
--- a/src/intel_api_factory.h
+++ b/src/intel_api_factory.h
@@ -25,8 +25,8 @@ extern "C"
 {
 #endif /* __cplusplus */

-HRESULT APIENTRY InitialiseMediaSession(_Out_ HANDLE* handle, _In_ LPVOID lpParam, _Reserved_ LPVOID lpReserved);
-HRESULT APIENTRY DisposeMediaSession(_In_ const HANDLE handle);
+HRESULT InitialiseMediaSession(_Out_ HANDLE* handle, _In_ LPVOID lpParam, _Reserved_ LPVOID lpReserved);
+HRESULT DisposeMediaSession(_In_ const HANDLE handle);

 #ifdef __cplusplus
 }
diff --git a/src/intel_gfx_api-x86.def b/src/intel_gfx_api-x86.def
index 19d0727..c9c15e6 100644
--- a/src/intel_gfx_api-x86.def
+++ b/src/intel_gfx_api-x86.def
@@ -1,4 +1,4 @@
 LIBRARY intel_gfx_api-x86.dll
 EXPORTS
-InitialiseMediaSession@12
-DisposeMediaSession@4
+InitialiseMediaSession^M
+DisposeMediaSession^M

[Linux]:create mfx path error

Error in generating the mfx path in Linux.
NG: /opt/intel/mediasdk/lib64/8086/0412
GOOD: /opt/intel/mediasdk/lib64

diff --git a/src/mfx_library_iterator_linux.cpp b/src/mfx_library_iterator_linux.cpp
index 5db9f81..382e8de 100644
--- a/src/mfx_library_iterator_linux.cpp
+++ b/src/mfx_library_iterator_linux.cpp
@@ -333,7 +333,7 @@ mfxStatus MFXLibraryIterator::Init(eMfxImplType implType, mfxIMPL impl,
     m_implType = implType;

     snprintf(m_path, sizeof(m_path)/sizeof(m_path[0]),
-             "%s/%s/%04x/%04x", mfx_storage_opt, mfx_folder, m_vendorID, m_deviceID);
+             "%s/%s", mfx_storage_opt, mfx_folder);

     m_libs_num = mfx_list_libraries(m_path, (MFX_LIB_HARDWARE == implType), &m_libs);

Error initializing an internal MFX session

Good afternoon, I have problem with the h264_qsv encoder. I saw this error (in ubuntu machine) when I was trying to make transcoding:
“[swscaler @ 0x27763e0] deprecated pixel format used, make sure you did set range correctly
[h264_qsv @ 0x269cba0] Error initializing an internal MFX session
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height”
I used the following command “ffmpeg -i video.mp4 -c:v h264_qsv -preset:v faster out.mp4”
I have installed libva, libdrm, libva-intel-driver , mfx_dispatch(from https://github.com/lu-zero/mfx_dispatch) with these instructions:
autoreconf -i
./configure --prefix=/usr
make -j 18
make install
and finally ffmpeg with ./configure enable-libmfx, make and make install.
Aditionally I can see this message if I try to see what hardware accelerations are enable“Supported hwaccels: qsv”.

error: build on mingw32 windows10

I followed the tip, but it shows that errors like DWORD not found while configuring, and actually I found window_*.h in the include directory

Linux Compile

I understand if this gets closed out quickly because it's a compilation issue and not a coding error. I'm not sure that I understand the dependencies correctly.

If I am on Linux then I don't need to install the Media SDK if I have libva installed?

Right now that is the case here. I am hesitant to install the SDK because I don't know where it puts everything. Does it default to /opt for all its files?

I compiled your dispatcher and pointed it to my ffmpeg_build directory for installation. This is exactly what I have done so far:

libmfx install
autoreconf -i
./configure --prefix=$HOME/ffmpeg_build
make -j 18
make install

PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --pkg-config-flags="--static" --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libmfx

tail config.log
3 int main(void) { return 0; }
END /tmp/ffconf.srZzUVvD.c
gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -I/home/brian/ffmpeg_build/include -std=c99 -fomit-frame-pointer -pthread -I/home/brian/ffmpeg_build/include -I/home/brian/ffmpeg_build/include -L/home/brian/ffmpeg_build/lib -c -o /tmp/ffconf.T8XBOPjH.o /tmp/ffconf.srZzUVvD.c
gcc -L/home/brian/ffmpeg_build/lib -Wl,--as-needed -Wl,-z,noexecstack -I/home/brian/ffmpeg_build/include -L/home/brian/ffmpeg_build/lib -o /tmp/ffconf.knjn9Kq7 /tmp/ffconf.T8XBOPjH.o -lmfx -lstdc++ -ldl -L/home/brian/ffmpeg_build/lib -lfdk-aac -lm -lm -lz -pthread
/home/brian/ffmpeg_build/lib/libmfx.a(libmfx_la-main.o): In function init_internal_hwctx': /home/brian/mfx_dispatch/src/main.cpp:930: undefined reference tomfx_allocate_va'
/home/brian/ffmpeg_build/lib/libmfx.a(libmfx_la-main.o): In function MFXClose': /home/brian/mfx_dispatch/src/main.cpp:531: undefined reference tomfx_deallocate_va'
collect2: error: ld returned 1 exit status
ERROR: libmfx not found using pkg-config

I'm not sure where to go from here. I couldn't find much help on IRC and it's not really an FFMPEG problem.

undefined reference to `MFXInit'

Hi

I was success install dispatcher on my server:

root@server4:/mfx_dispatch# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local
-- Intel Media SDK is here: /root/mfx_dispatch
-- Configuring done
-- Generating done
-- Build files have been written to: /root/mfx_dispatch
root@server4:
/mfx_dispatch# make -j
[ 25%] [ 25%] [ 25%] [ 33%] [ 41%] Building CXX object CMakeFiles/mfx.dir/src/main.cpp.o
Building CXX object CMakeFiles/mfx.dir/src/mfx_critical_section_linux.cpp.o
Building CXX object CMakeFiles/mfx.dir/src/mfx_critical_section.cpp.o
[ 58%] [ 58%] Building CXX object CMakeFiles/mfx.dir/src/mfx_dispatcher.cpp.o
Building CXX object CMakeFiles/mfx.dir/src/mfx_dxva2_device.cpp.o
Building CXX object CMakeFiles/mfx.dir/src/mfx_dispatcher_log.cpp.o
[ 66%] [ 75%] Building CXX object CMakeFiles/mfx.dir/src/mfx_function_table.cpp.o
[ 83%] [ 91%] [100%] Building CXX object CMakeFiles/mfx.dir/src/mfx_library_iterator.cpp.o
Building CXX object CMakeFiles/mfx.dir/src/mfx_load_dll.cpp.o
Building CXX object CMakeFiles/mfx.dir/src/mfx_library_iterator_linux.cpp.o
Building CXX object CMakeFiles/mfx.dir/src/mfx_load_dll_linux.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
root@server4:~/mfx_dispatch# make install
[100%] Built target mfx
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/include/mfxmvc.h
-- Installing: /usr/local/include/mfxstructures.h
-- Installing: /usr/local/include/mfxastructures.h
-- Installing: /usr/local/include/mfxvideo.h
-- Installing: /usr/local/include/mfxaudio.h
-- Installing: /usr/local/include/mfxsession.h
-- Installing: /usr/local/include/mfxvstructures.h
-- Installing: /usr/local/include/mfxjpeg.h
-- Installing: /usr/local/include/mfxaudio++.h
-- Installing: /usr/local/include/mfxcommon.h
-- Installing: /usr/local/include/mfxla.h
-- Installing: /usr/local/include/mfxdefs.h
-- Installing: /usr/local/include/mfxenc.h
-- Installing: /usr/local/include/mfxplugin.h
-- Installing: /usr/local/include/mfxvideo++.h
-- Installing: /usr/local/include/mfxplugin++.h
-- Installing: /usr/local/lib/pkgconfig/libmfx.pc
-- Installing: /usr/local/lib/libmfx.a

After I try configure libav-qsv, I get error:
root@server4:~/libav-qsv# ./configure --enable-libmfx --enable-memalign-hack --extra-libs="-lsupc++ -lstdc++"
ERROR: libmfx not found

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
[email protected] mailing list or IRC #libav on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem

There is last strings related dispatcher:

gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -std=c99 -fomit-frame-pointer -pthread -I/usr/local/include -I/root/mfx_dispatch /usr/local/lib/libmfx.a -L/usr/local/lib -c -o /tmp/ffconf.ULRa4u11.o /tmp/ffconf.bSVvuwIW.c
gcc: warning: /usr/local/lib/libmfx.a: linker input file unused because linking not done
gcc -Wl,--as-needed -I/usr/local/include -I/root/mfx_dispatch /usr/local/lib/libmfx.a -L/usr/local/lib -o /tmp/ffconf.6X5q3o0K /tmp/ffconf.ULRa4u11.o -lsupc++ -lm -lbz2 -lz -pthread -lsupc++ -lstdc++
/tmp/ffconf.ULRa4u11.o: In function check_MFXInit': ffconf.bSVvuwIW.c:(.text+0x1): undefined reference toMFXInit'
collect2: error: ld returned 1 exit status
ERROR: libmfx not found

Can you help my understand why I get this error?

Error initializing an internal MFX session

Hi,

I am on debian testing and I tried to get ffmpeg working. What I did so far was:

apt-get build-dep ffmpeg # pulls all the -dev packages
apt-get install libva-dev

checked out mfx_dispatch master and executed statements

autoreconf -i ./configure --prefix=/usr make -j 18 make install

Then I got the ffmpeg master from git and configured with:

./configure --disable-shared --enable-static --enable-gpl --enable-nonfree --enable-fontconfig --enable-libfreetype --enable-libmp3lame --enable-librtmp --enable-libx264 --enable-libx265 --enable-version3 --disable-ffplay --disable-doc --disable-ffserver --enable-pthreads --enable-filters --enable-libvorbis --enable-libtheora --enable-runtime-cpudetect --enable-libass --enable-bzlib --enable-zlib --enable-libmfx --prefix=/opt/ffmpeg_qsv/

But whenever I run (even as root) ffmpeg from that path, I get

[hevc_qsv @ 0x344aba0] Error initializing an internal MFX session
Output #0, matroska, to 'output.mkv':
    Stream #0:0: Video: hevc, none, q=2-31, 128 kb/s, SAR 1:1 DAR 0:0, 23.98 fps
    Metadata:
      encoder         : Lavc57.28.101 hevc_qsv
    Stream #0:1(eng): Audio: ac3, 48000 Hz, stereo, 384 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> hevc (hevc_qsv))
  Stream #0:1 -> #0:1 (copy)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

Where am I going wrong?

Building lu-zero/libav

Using clean Centos 6.6 with Intel MSDK
Installed libva, libdrm etc, then installed mfx_dispatch:
autoreconf -i && ./configure --prefix... && make && make install

got libav from lu-zero/libav

Configured:

PKG_CONFIG_PATH=/encoder/lib/pkgconfig LDFLAGS="-L/encoder/lib -L/opt/intel/mediasdk/lib -L/opt/intel/mediasdk/lib64" CFLAGS="-I/encoder/include/ -I/opt/intel/mediasdk/include/" ./configure --prefix=/encoder --enable-libmfx

make
....
CC libavcodec/qsv.o
In file included from /encoder/include/mfx/mfxsession.h:32,
from /encoder/include/mfx/mfxvideo.h:32,
from libavcodec/qsv.c:27:
/encoder/include/mfx/mfxcommon.h:81: warning: declaration does not declare anything
/encoder/include/mfx/mfxcommon.h:101: warning: declaration does not declare anything
/encoder/include/mfx/mfxcommon.h:103: warning: declaration does not declare anything
/encoder/include/mfx/mfxcommon.h:127: warning: declaration does not declare anything
/encoder/include/mfx/mfxcommon.h:129: warning: declaration does not declare anything
In file included from /encoder/include/mfx/mfxvstructures.h:30,
from /encoder/include/mfx/mfxvideo.h:33,
from libavcodec/qsv.c:27:
/encoder/include/mfx/mfxstructures.h:51: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:54: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:55: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:79: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:83: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:84: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:169: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:181: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:188: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:198: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:204: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:252: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:258: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:263: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:268: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:275: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:282: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:288: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:289: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:306: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:714: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:718: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:719: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:1004: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:1008: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:1012: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:1146: warning: declaration does not declare anything
/encoder/include/mfx/mfxstructures.h:1165: warning: declaration does not declare anything
libavcodec/qsv.c: In function "qsv_init_session":
libavcodec/qsv.c:107: warning: braces around scalar initializer
libavcodec/qsv.c:107: warning: (near initialization for "ver.Version")
libavcodec/qsv.c:107: warning: excess elements in scalar initializer
libavcodec/qsv.c:107: warning: (near initialization for "ver.Version")
libavcodec/qsv.c: In function "ff_qsv_init":
libavcodec/qsv.c:159: error: "mfxVideoParam" has no member named "mfx"
libavcodec/qsv.c:160: error: "mfxVideoParam" has no member named "mfx"
libavcodec/qsv.c:161: error: "mfxVideoParam" has no member named "mfx"
libavcodec/qsv.c:163: error: "mfxVideoParam" has no member named "mfx"
libavcodec/qsv.c:164: error: "mfxVideoParam" has no member named "mfx"
libavcodec/qsv.c:165: error: "mfxVideoParam" has no member named "mfx"
libavcodec/qsv.c:166: error: "mfxVideoParam" has no member named "mfx"
libavcodec/qsv.c:167: error: "mfxVideoParam" has no member named "mfx"
libavcodec/qsv.c:168: error: "mfxVideoParam" has no member named "mfx"
libavcodec/qsv.c:169: error: "mfxVideoParam" has no member named "mfx"
libavcodec/qsv.c: In function "alloc_frame":
libavcodec/qsv.c:198: error: "mfxFrameInfo" has no member named "Width"
libavcodec/qsv.c:199: error: "mfxFrameInfo" has no member named "Height"
libavcodec/qsv.c:202: error: "mfxFrameData" has no member named "PitchLow"
libavcodec/qsv.c:203: error: "mfxFrameData" has no member named "Y"
libavcodec/qsv.c:204: error: "mfxFrameData" has no member named "UV"
libavcodec/qsv.c: In function "ff_qsv_decode":
libavcodec/qsv.c:279: warning: braces around scalar initializer
libavcodec/qsv.c:279: warning: (near initialization for "bs.DecodeTimeStamp")
libavcodec/qsv.c:279: warning: braces around scalar initializer
libavcodec/qsv.c:279: warning: (near initialization for "bs.DecodeTimeStamp")
make: *** [libavcodec/qsv.o] Error 1

Any advise please.
Am I missing some additional library?

Linking problem and unresolved symbols

Hi,
using mingw-w64 to build on windows.

I'm using latest version of mfx_dispatch. I launch a mingw32_shell, then I do:

autoreconf -i
configure --prefix=/usr/local
make -j4
make install

This will create a libmfx.a file and will correctly install the libmfx.pc file in /usr/local/lib/pkgconfig.

One anomaly I noted during the autoreconf -i step is the "libtoolize: error: Files" message:

autoreconf -i -v
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy
libtoolize:   error: Files
autoreconf: running: /usr/bin/autoconf
autoreconf: configure.ac: not using Autoheader
autoreconf: running: automake --add-missing --copy --no-force
autoreconf: Leaving directory `.'

Now I try to build libav and the configure fails:

echo $PKG_CONFIG_PATH
/usr/local/lib/pkgconfig:/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig

./configure --enable-libmfx

This is the relevant part of config.log:

check_pkg_config libmfx mfx/mfxvideo.h MFXInit
pkg-config --exists --print-errors libmfx
check_func_headers mfx/mfxvideo.h MFXInit -I/usr/local/include -L/usr/local/lib -lmfx -lstdc++
check_ld -I/usr/local/include -L/usr/local/lib -lmfx -lstdc++
check_cc -I/usr/local/include -L/usr/local/lib
BEGIN /tmp/ffconf.3jlH2t3w.c
    1   #include <mfx/mfxvideo.h>
    2   long check_MFXInit(void) { return (long) MFXInit; }
    3   int main(void) { return 0; }
END /tmp/ffconf.3jlH2t3w.c
gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__ -DPIC -std=c99 -

fomit-frame-pointer -pthread -I/us
r/local/include -L/usr/local/lib -c -o /tmp/ffconf.QLThWFhP.o /tmp/ffconf.3jlH2t3w.c
gcc -Wl,--nxcompat -Wl,--dynamicbase -Wl,--as-needed -I/usr/local/include -L/usr/local/lib -o 

/tmp/ffconf.GhxQxLrE.exe /tmp/ffconf.Q
LThWFhP.o -lmfx -lstdc++ -lm -pthread -lpsapi -ladvapi32 -lshell32
/usr/local/lib/libmfx.a(libmfx_la-main.o): In function `MFXAutomaticCriticalSection':
/home/foo/mfx_dispatch/src/mfx_critical_section.h:55: undefined reference to 

`MFX::mfxEnterCriticalSection(int volatile*)'
/home/foo/mfx_dispatch/src/mfx_critical_section.h:55:(.text+0x86): relocation truncated to fit: 

R_X86_64_PC32 against undefined sym
bol `MFX::mfxEnterCriticalSection(int volatile*)'
/usr/local/lib/libmfx.a(libmfx_la-main.o): In function `MFXInitEx':
/home/foo/mfx_dispatch/src/main.cpp:196: undefined reference to 

`MFX::MFXLibraryIterator::MFXLibraryIterator()'
/home/foo/mfx_dispatch/src/main.cpp:196:(.text+0xb2): relocation truncated to fit: R_X86_64_PC32 

against undefined symbol `MFX::MFXLibraryIterator::MFXLibraryIterator()'
/home/foo/mfx_dispatch/src/main.cpp:196: undefined reference to 

`MFX::MFXLibraryIterator::~MFXLibraryIterator()'
/home/foo/mfx_dispatch/src/main.cpp:196:(.text+0xf6): relocation truncated to fit: R_X86_64_PC32 

against undefined symbol `MFX::MFXLibraryIterator::~MFXLibraryIterator()'
/usr/local/lib/libmfx.a(libmfx_la-main.o): In function `~MFXAutomaticCriticalSection':
/home/foo/mfx_dispatch/src/mfx_critical_section.h:61: undefined reference to 

`MFX::mfxLeaveCriticalSection(int volatile*)'
/home/foo/mfx_dispatch/src/mfx_critical_section.h:61:(.text+0x141): relocation truncated to fit: 

R_X86_64_PC32 against undefined symbol `MFX::mfxLeaveCriticalSection(int volatile*)'
/usr/local/lib/libmfx.a(libmfx_la-main.o): In function `MFXInitEx':
/home/foo/mfx_dispatch/src/main.cpp:252: undefined reference to `MFX::MFXLibraryIterator::Init

(eMfxImplType, int, unsigned int, int)'
/home/foo/mfx_dispatch/src/main.cpp:252:(.text+0x21d): relocation truncated to fit: R_X86_64_PC32 

against undefined symbol `MFX::MFXLibraryIterator::Init(eMfxImplType, int, unsigned int, int)'
/home/foo/mfx_dispatch/src/main.cpp:275: undefined reference to 

`MFX::MFXLibraryIterator::SelectDLLVersion(char*, unsigned long, eMfxImplType*, mfxVersion)'
/home/foo/mfx_dispatch/src/main.cpp:275:(.text+0x25f): relocation truncated to fit: R_X86_64_PC32 

against undefined symbol `MFX::MFXLibraryIterator::SelectDLLVersion(char*, unsigned long, 

eMfxImplType*, mfxVersion)'
/home/foo/mfx_dispatch/src/main.cpp:293: undefined reference to 

`MFX::MFXLibraryIterator::GetSubKeyName(char*, unsigned long) const'
/home/foo/mfx_dispatch/src/main.cpp:293:(.text+0x2b5): relocation truncated to fit: R_X86_64_PC32 

against undefined symbol `MFX::MFXLibraryIterator::GetSubKeyName(char*, unsigned long) const'
/home/foo/mfx_dispatch/src/main.cpp:321: undefined reference to `MFX::MFXLibraryIterator::Init

(eMfxImplType, int, unsigned int, int)'
/home/foo/mfx_dispatch/src/main.cpp:321:(.text+0x352): relocation truncated to fit: R_X86_64_PC32 

against undefined symbol `MFX::MFXLibraryIterator::Init(eMfxImplType, int, unsigned int, int)'
/home/foo/mfx_dispatch/src/main.cpp:342: undefined reference to 

`MFX::MFXLibraryIterator::SelectDLLVersion(char*, unsigned long, eMfxImplType*, mfxVersion)'
/home/foo/mfx_dispatch/src/main.cpp:342:(.text+0x39a): relocation truncated to fit: R_X86_64_PC32 

against undefined symbol `MFX::MFXLibraryIterator::SelectDLLVersion(char*, unsigned long, 

eMfxImplType*, mfxVersion)'
/home/foo/mfx_dispatch/src/main.cpp:390: undefined reference to 

`MFX::mfx_get_default_audio_dll_name(char*, unsigned long, eMfxImplType)'
/home/foo/mfx_dispatch/src/main.cpp:390:(.text+0x4f2): relocation truncated to fit: R_X86_64_PC32 

against undefined symbol `MFX::mfx_get_default_audio_dll_name(char*, unsigned long, eMfxImplType)'
/home/foo/mfx_dispatch/src/main.cpp:476: undefined reference to 

`MFX::MFXDefaultPlugins::MFXDefaultPlugins(mfxVersion, MFX_DISP_HANDLE*, int)'
/home/foo/mfx_dispatch/src/main.cpp:476:(.text+0x62b): additional relocation overflows omitted from 

the output
/home/foo/mfx_dispatch/src/main.cpp:482: undefined reference to 

`MFX::MFXPluginsInHive::MFXPluginsInHive(int, char const*, mfxVersion)'
/home/foo/mfx_dispatch/src/main.cpp:490: undefined reference to 

`MFX::MFXPluginsInHive::MFXPluginsInHive(int, char const*, mfxVersion)'
/home/foo/mfx_dispatch/src/main.cpp:396: undefined reference to `MFX::mfx_get_default_dll_name

(char*, unsigned long, eMfxImplType)'
/home/foo/mfx_dispatch/src/main.cpp:410: undefined reference to `MFX::SelectImplementationType

(unsigned int, int*, unsigned int*, unsigned int*)'
/home/foo/mfx_dispatch/src/main.cpp:264: undefined reference to 

`MFX::MFXLibraryIterator::GetImplementationType()'
/home/foo/mfx_dispatch/src/main.cpp:331: undefined reference to 

`MFX::MFXLibraryIterator::GetImplementationType()'
/usr/local/lib/libmfx.a(libmfx_la-main.o): In function `~MFXAutomaticCriticalSection':
/home/foo/mfx_dispatch/src/mfx_critical_section.h:61: undefined reference to 

`MFX::mfxLeaveCriticalSection(int volatile*)'
/usr/local/lib/libmfx.a(libmfx_la-main.o): In function `MFXInitEx':
/home/foo/mfx_dispatch/src/main.cpp:196: undefined reference to 

`MFX::MFXLibraryIterator::~MFXLibraryIterator()'
/home/foo/mfx_dispatch/src/main.cpp:494: undefined reference to 

`MFX::MFXPluginsInFS::MFXPluginsInFS(mfxVersion)'
/usr/local/lib/libmfx.a(libmfx_la-main.o): In function `MFXAutomaticCriticalSection':
/home/foo/mfx_dispatch/src/mfx_critical_section.h:55: undefined reference to 

`MFX::mfxEnterCriticalSection(int volatile*)'
/usr/local/lib/libmfx.a(libmfx_la-main.o): In function `~MFXAutomaticCriticalSection':
/home/foo/mfx_dispatch/src/mfx_critical_section.h:61: undefined reference to 

`MFX::mfxLeaveCriticalSection(int volatile*)'
/home/foo/mfx_dispatch/src/mfx_critical_section.h:61: undefined reference to 

`MFX::mfxLeaveCriticalSection(int volatile*)'
/usr/local/lib/libmfx.a(libmfx_la-mfx_dispatcher.o): In function 

`MFX_DISP_HANDLE::UnLoadSelectedDLL()':
/home/foo/mfx_dispatch/src/mfx_dispatcher.cpp:354: undefined reference to `MFX::mfx_dll_free

(void*)'
/usr/local/lib/libmfx.a(libmfx_la-mfx_dispatcher.o): In function `MFX_DISP_HANDLE::LoadSelectedDLL

(char const*, eMfxImplType, int, int, mfxInitParam&)':
/home/foo/mfx_dispatch/src/mfx_dispatcher.cpp:154: undefined reference to `MFX::mfx_dll_load(char 

const*)'
/home/foo/mfx_dispatch/src/mfx_dispatcher.cpp:173: undefined reference to `MFX::mfx_dll_get_addr

(void*, char const*)'
/home/foo/mfx_dispatch/src/mfx_dispatcher.cpp:202: undefined reference to `MFX::mfx_dll_get_addr

(void*, char const*)'
/usr/local/lib/libmfx.a(libmfx_la-mfx_load_plugin.o): In function `MFX::PluginModule::PluginModule

(MFX::PluginModule const&)':
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:48: undefined reference to `MFX::mfx_dll_load(char 

const*)'
/usr/local/lib/libmfx.a(libmfx_la-mfx_load_plugin.o): In function `MFX::PluginModule::Tidy()':
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:103: undefined reference to `MFX::mfx_dll_free

(void*)'
/usr/local/lib/libmfx.a(libmfx_la-mfx_load_plugin.o): In function `MFX::PluginModule::operator=

(MFX::PluginModule const&)':
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:59: undefined reference to `MFX::mfx_dll_load(char 

const*)'
/usr/local/lib/libmfx.a(libmfx_la-mfx_load_plugin.o): In function `MFX::PluginModule::PluginModule

(char const*)':
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:69: undefined reference to `MFX::mfx_dll_load(char 

const*)'
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:76: undefined reference to `MFX::mfx_dll_get_addr

(void*, char const*)'
/usr/local/lib/libmfx.a(libmfx_la-mfx_load_plugin.o): In function `MFX::PluginModule::Tidy()':
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:103: undefined reference to `MFX::mfx_dll_free

(void*)'
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:103: undefined reference to `MFX::mfx_dll_free

(void*)'
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:103: undefined reference to `MFX::mfx_dll_free

(void*)'
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:103: undefined reference to `MFX::mfx_dll_free

(void*)'
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:103: undefined reference to `MFX::mfx_dll_free

(void*)'
/usr/local/lib/libmfx.a(libmfx_la-

mfx_load_plugin.o):/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:103: more undefined references to 

`MFX::mfx_dll_free(void*)' follow
collect2: error: ld returned 1 exit status
ERROR: libmfx not found

Similar problem happens when configuring ffmpeg.

If I configure mfx_dispatch with --enable-shared I got some similar linking problems during compilation:

libtool: link: g++ -shared -nostdlib /usr/lib/gcc/x86_64-pc-msys/4.9.2/crtbeginS.o  src/.libs/libmfx_la-main.o src/.libs/libmfx_la-mfx_critical_section.o src/.libs/libmfx_la-mfx_dispatcher.o src/.libs/libmfx_la-mfx_dispatcher_log.o src/.libs/libmfx_la-mfx_load_plugin.o src/.libs/libmfx_la-mfx_plugin_cfg_parser.o src/.libs/libmfx_la-mfx_function_table.o src/.libs/libmfx_la-mfx_dxva2_device.o src/.libs/libmfx_la-mfx_library_iterator.o src/.libs/libmfx_la-mfx_load_dll.o src/.libs/libmfx_la-mfx_win_reg_key.o src/.libs/libmfx_la-mfx_plugin_hive.o   -L/usr/lib/gcc/x86_64-pc-msys/4.9.2 -L/usr/lib/gcc/x86_64-pc-msys/4.9.2/../../../../x86_64-pc-msys/lib/../lib -L/usr/lib/gcc/x86_64-pc-msys/4.9.2/../../../../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-msys/4.9.2/../../../../x86_64-pc-msys/lib -L/usr/lib/gcc/x86_64-pc-msys/4.9.2/../../.. -lstdc++ -lgcc_s -lgcc -lmsys-2.0 -ladvapi32 -lshell32 -luser32 -lkernel32 -lgcc_s -lgcc /usr/lib/gcc/x86_64-pc-msys/4.9.2/crtend.o  -g -O2   -o .libs/libmfx-0.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libmfx.dll.a
src/.libs/libmfx_la-main.o: In function `MFXAutomaticCriticalSection':
/home/foo/mfx_dispatch/src/mfx_critical_section.h:55: undefined reference to `MFX::mfxEnterCriticalSection(int volatile*)'
/home/foo/mfx_dispatch/src/mfx_critical_section.h:55:(.text+0x86): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `MFX::mfxEnterCriticalSection(int volatile*)'
src/.libs/libmfx_la-main.o: In function `MFXInitEx':
/home/foo/mfx_dispatch/src/main.cpp:196: undefined reference to `MFX::MFXLibraryIterator::MFXLibraryIterator()'
/home/foo/mfx_dispatch/src/main.cpp:196:(.text+0xb2): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `MFX::MFXLibraryIterator::MFXLibraryIterator()'
/home/foo/mfx_dispatch/src/main.cpp:196: undefined reference to `MFX::MFXLibraryIterator::~MFXLibraryIterator()'
/home/foo/mfx_dispatch/src/main.cpp:196:(.text+0xf6): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `MFX::MFXLibraryIterator::~MFXLibraryIterator()'
src/.libs/libmfx_la-main.o: In function `~MFXAutomaticCriticalSection':
/home/foo/mfx_dispatch/src/mfx_critical_section.h:61: undefined reference to `MFX::mfxLeaveCriticalSection(int volatile*)'
/home/foo/mfx_dispatch/src/mfx_critical_section.h:61:(.text+0x141): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `MFX::mfxLeaveCriticalSection(int volatile*)'
src/.libs/libmfx_la-main.o: In function `MFXInitEx':
/home/foo/mfx_dispatch/src/main.cpp:252: undefined reference to `MFX::MFXLibraryIterator::Init(eMfxImplType, int, unsigned int, int)'
/home/foo/mfx_dispatch/src/main.cpp:252:(.text+0x21d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `MFX::MFXLibraryIterator::Init(eMfxImplType, int, unsigned int, int)'
/home/foo/mfx_dispatch/src/main.cpp:275: undefined reference to `MFX::MFXLibraryIterator::SelectDLLVersion(char*, unsigned long, eMfxImplType*, mfxVersion)'
/home/foo/mfx_dispatch/src/main.cpp:275:(.text+0x25f): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `MFX::MFXLibraryIterator::SelectDLLVersion(char*, unsigned long, eMfxImplType*, mfxVersion)'
/home/foo/mfx_dispatch/src/main.cpp:293: undefined reference to `MFX::MFXLibraryIterator::GetSubKeyName(char*, unsigned long) const'
/home/foo/mfx_dispatch/src/main.cpp:293:(.text+0x2b5): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `MFX::MFXLibraryIterator::GetSubKeyName(char*, unsigned long) const'
/home/foo/mfx_dispatch/src/main.cpp:321: undefined reference to `MFX::MFXLibraryIterator::Init(eMfxImplType, int, unsigned int, int)'
/home/foo/mfx_dispatch/src/main.cpp:321:(.text+0x352): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `MFX::MFXLibraryIterator::Init(eMfxImplType, int, unsigned int, int)'
/home/foo/mfx_dispatch/src/main.cpp:342: undefined reference to `MFX::MFXLibraryIterator::SelectDLLVersion(char*, unsigned long, eMfxImplType*, mfxVersion)'
/home/foo/mfx_dispatch/src/main.cpp:342:(.text+0x39a): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `MFX::MFXLibraryIterator::SelectDLLVersion(char*, unsigned long, eMfxImplType*, mfxVersion)'
/home/foo/mfx_dispatch/src/main.cpp:390: undefined reference to `MFX::mfx_get_default_audio_dll_name(char*, unsigned long, eMfxImplType)'
/home/foo/mfx_dispatch/src/main.cpp:390:(.text+0x4f2): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `MFX::mfx_get_default_audio_dll_name(char*, unsigned long, eMfxImplType)'
/home/foo/mfx_dispatch/src/main.cpp:476: undefined reference to `MFX::MFXDefaultPlugins::MFXDefaultPlugins(mfxVersion, MFX_DISP_HANDLE*, int)'
/home/foo/mfx_dispatch/src/main.cpp:476:(.text+0x62b): additional relocation overflows omitted from the output
/home/foo/mfx_dispatch/src/main.cpp:482: undefined reference to `MFX::MFXPluginsInHive::MFXPluginsInHive(int, char const*, mfxVersion)'
/home/foo/mfx_dispatch/src/main.cpp:490: undefined reference to `MFX::MFXPluginsInHive::MFXPluginsInHive(int, char const*, mfxVersion)'
/home/foo/mfx_dispatch/src/main.cpp:396: undefined reference to `MFX::mfx_get_default_dll_name(char*, unsigned long, eMfxImplType)'
/home/foo/mfx_dispatch/src/main.cpp:410: undefined reference to `MFX::SelectImplementationType(unsigned int, int*, unsigned int*, unsigned int*)'
/home/foo/mfx_dispatch/src/main.cpp:264: undefined reference to `MFX::MFXLibraryIterator::GetImplementationType()'
/home/foo/mfx_dispatch/src/main.cpp:331: undefined reference to `MFX::MFXLibraryIterator::GetImplementationType()'
src/.libs/libmfx_la-main.o: In function `~MFXAutomaticCriticalSection':
/home/foo/mfx_dispatch/src/mfx_critical_section.h:61: undefined reference to `MFX::mfxLeaveCriticalSection(int volatile*)'
src/.libs/libmfx_la-main.o: In function `MFXInitEx':
/home/foo/mfx_dispatch/src/main.cpp:196: undefined reference to `MFX::MFXLibraryIterator::~MFXLibraryIterator()'
/home/foo/mfx_dispatch/src/main.cpp:494: undefined reference to `MFX::MFXPluginsInFS::MFXPluginsInFS(mfxVersion)'
src/.libs/libmfx_la-main.o: In function `MFXAutomaticCriticalSection':
/home/foo/mfx_dispatch/src/mfx_critical_section.h:55: undefined reference to `MFX::mfxEnterCriticalSection(int volatile*)'
src/.libs/libmfx_la-main.o: In function `~MFXAutomaticCriticalSection':
/home/foo/mfx_dispatch/src/mfx_critical_section.h:61: undefined reference to `MFX::mfxLeaveCriticalSection(int volatile*)'
/home/foo/mfx_dispatch/src/mfx_critical_section.h:61: undefined reference to `MFX::mfxLeaveCriticalSection(int volatile*)'
src/.libs/libmfx_la-mfx_dispatcher.o: In function `MFX_DISP_HANDLE::UnLoadSelectedDLL()':
/home/foo/mfx_dispatch/src/mfx_dispatcher.cpp:354: undefined reference to `MFX::mfx_dll_free(void*)'
src/.libs/libmfx_la-mfx_dispatcher.o: In function `MFX_DISP_HANDLE::LoadSelectedDLL(char const*, eMfxImplType, int, int, mfxInitParam&)':
/home/foo/mfx_dispatch/src/mfx_dispatcher.cpp:154: undefined reference to `MFX::mfx_dll_load(char const*)'
/home/foo/mfx_dispatch/src/mfx_dispatcher.cpp:173: undefined reference to `MFX::mfx_dll_get_addr(void*, char const*)'
/home/foo/mfx_dispatch/src/mfx_dispatcher.cpp:202: undefined reference to `MFX::mfx_dll_get_addr(void*, char const*)'
src/.libs/libmfx_la-mfx_load_plugin.o: In function `MFX::PluginModule::PluginModule(MFX::PluginModule const&)':
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:48: undefined reference to `MFX::mfx_dll_load(char const*)'
src/.libs/libmfx_la-mfx_load_plugin.o: In function `MFX::PluginModule::Tidy()':
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:103: undefined reference to `MFX::mfx_dll_free(void*)'
src/.libs/libmfx_la-mfx_load_plugin.o: In function `MFX::PluginModule::operator=(MFX::PluginModule const&)':
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:59: undefined reference to `MFX::mfx_dll_load(char const*)'
src/.libs/libmfx_la-mfx_load_plugin.o: In function `MFX::PluginModule::PluginModule(char const*)':
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:69: undefined reference to `MFX::mfx_dll_load(char const*)'
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:76: undefined reference to `MFX::mfx_dll_get_addr(void*, char const*)'
src/.libs/libmfx_la-mfx_load_plugin.o: In function `MFX::PluginModule::Tidy()':
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:103: undefined reference to `MFX::mfx_dll_free(void*)'
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:103: undefined reference to `MFX::mfx_dll_free(void*)'
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:103: undefined reference to `MFX::mfx_dll_free(void*)'
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:103: undefined reference to `MFX::mfx_dll_free(void*)'
/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:103: undefined reference to `MFX::mfx_dll_free(void*)'
src/.libs/libmfx_la-mfx_load_plugin.o:/home/foo/mfx_dispatch/src/mfx_load_plugin.cpp:103: more undefined references to `MFX::mfx_dll_free(void*)' follow
collect2: error: ld returned 1 exit status
Makefile:582: recipe for target 'libmfx.la' failed
make: *** [libmfx.la] Error 1

My guess is that either the build system is somehow broken, or I'm doing some wrong assumptions about the compilation flags and/or the build environment (for example I'm using the mingw-w64 mingw32 shell because otherwise the libav configure will fail with "Unknown OS 'mingw64_nt-6.3'"). I tried several other combinations with no success so far.

In the latter case, the build/environment assumptions should be specified better.

Thanks for your time.

Add license info to repo

Could license data related to the project and its code be added to the repo please. This would clarify for projects and allow in decision making to add to projects or distros or not.

on windows 10 compile mfx_dispatch with MSDK 2021 R1 and FFMPEG for QSV function failed, do you have any guide for this?

when I running ./ffmpeg.exe -i in.mp4 -vcodec h264_qsv out.h264
it report error:
[h264_qsv @ 000002305B5F00C0] Error querying encoder params: unsupported (-3)
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

and when compile the FFMPEG with :mfx.lib is not found.
../configure --disable-stripping --disable-static --enable-shared --enable-debug=3 --disable-optimizations --enable-libmfx --enable-encoder=h264_qsv --enable-decoder=h264_qsv --toolchain=msvc --enable-cross-compile --extra-cflags='-I/C:/msys64/mingw64/include' --extra-ldflags='-libpath:/C:/msys64/mingw64/lib -DEFAULTLIB:legacy_stdio_definitions.lib' --prefix=../build
it log report:
check_pkg_config libmfx libmfx mfx/mfxvideo.h MFXInit
test_pkg_config libmfx libmfx mfx/mfxvideo.h MFXInit
pkg-config --exists --print-errors libmfx
check_func_headers mfx/mfxvideo.h MFXInit -IC:/msys64/mingw64/include -LC:/msys64/mingw64/lib -lmfx -lstdc++ -lole32 -luuid
test_ld cc -IC:/msys64/mingw64/include -LC:/msys64/mingw64/lib -lmfx -lstdc++ -lole32 -luuid
test_cc -IC:/msys64/mingw64/include -libpath:C:/msys64/mingw64/lib
BEGIN ./ffconf.ALlfLpqR/test.c
1 #include <mfx/mfxvideo.h>
2 #include <stdint.h>
3 long check_MFXInit(void) { return (long) MFXInit; }
4 int main(void) { int ret = 0;
5 ret |= ((intptr_t)check_MFXInit) & 0xFFFF;
6 return ret; }
END ./ffconf.ALlfLpqR/test.c
cl.exe -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_WIN32_WINNT=0x0600 -DPIC -nologo -I/C:/msys64/mingw64/include -IC:/msys64/mingw64/include -libpath:C:/msys64/mingw64/lib -c -Fo./ffconf.ALlfLpqR/test.o ./ffconf.ALlfLpqR/test.c
cl : Command line warning D9002 : ignoring unknown option '-libpath:C:/msys64/mingw64/lib'
test.c
./ffconf.ALlfLpqR/test.c(3): warning C4311: 'type cast': pointer truncation from 'mfxStatus (__cdecl *)(mfxIMPL,mfxVersion *,mfxSession *)' to 'long'
/home/iotg/package/FFmpeg/compat/windows/mslink -libpath:/C:/msys64/mingw64/lib -DEFAULTLIB:legacy_stdio_definitions.lib -nologo -IC:/msys64/mingw64/include -libpath:C:/msys64/mingw64/lib -out:./ffconf.ALlfLpqR/test.exe ./ffconf.ALlfLpqR/test.o mfx.lib ole32.lib uuid.lib
LINK : warning LNK4044: unrecognized option '/IC:/msys64/mingw64/include'; ignored
LINK : fatal error LNK1181: cannot open input file 'mfx.lib'
require libmfx mfx/mfxvideo.h MFXInit -llibmfx -ladvapi32
check_lib libmfx mfx/mfxvideo.h MFXInit -llibmfx -ladvapi32
check_func_headers mfx/mfxvideo.h MFXInit -llibmfx -ladvapi32
test_ld cc -llibmfx -ladvapi32
test_cc
BEGIN ./ffconf.ALlfLpqR/test.c
1 #include <mfx/mfxvideo.h>
2 #include <stdint.h>
3 long check_MFXInit(void) { return (long) MFXInit; }
4 int main(void) { int ret = 0;
5 ret |= ((intptr_t)check_MFXInit) & 0xFFFF;
6 return ret; }
END ./ffconf.ALlfLpqR/test.c

on windows, mfx_dispatcher compile result is libmfx.a and libmfx.la, which can not be use in FFmpeg. it just require libmfx.lib

Error running QSV encoder on Ubuntu 16.04

I build FFMPEG with NVENC and QSV support on Ubuntu 16.04, but when I try to run SimpleScreenRecorder, I get this error:

[h264_qsv @ 0x2348400] Error initializing an internal MFX session

Here is the script that I use to build MFX-Dispatch and FFMPEG.

OS X support?

Is there a specific reason for not supporting OS X? libmfx builds fine for darwin as far as I know.

Error when trying to compile with ffmpeg

When trying to compile with ffmpeg using the rdp ffmpeg build helpers scripts it throws an error:

Updating to latest mfx_dispatch_git git version [origin/master]...
Already up-to-date.
got no code changes, not forcing reconfigure for that...

making /ffmpeg/sandbox/win32/mfx_dispatch_git as $ PATH=/ffmpeg/sandbox/cross_compilers/mingw-w64-i686/bin:$PATH make -j 4

cd . && /bin/bash /ffmpeg/sandbox/win32/mfx_dispatch_git/missing automake-1.15 --foreign
configure.ac:37: error: required file './compile' not found
configure.ac:37: 'automake --add-missing' can install 'compile'
Makefile:480: recipe for target 'Makefile.in' failed
make: *** [Makefile.in] Error 1

It looks like automake --add-missing needs to be added. Can this be done?

Compile error

I'm getting the following error when trying to compile libmfx:

In file included from src/mfx_dispatcher.h:38:0,
                 from src/main.cpp:31:
src/mfx_exposed_functions_list.h: In function ‘mfxStatus MFXVideoCORE_SetHandle(mfxSession, mfxHandleType, mfxHDL)’:
src/mfx_exposed_functions_list.h:54:21: error: redefinition of ‘mfxStatus MFXVideoCORE_SetHandle(mfxSession, mfxHandleType, mfxHDL)’
 FUNCTION(mfxStatus, MFXVideoCORE_SetHandle, (mfxSession session, mfxHandleType type, mfxHDL hdl), (session, type, hdl))
                     ^
src/mfx_dispatcher_defs.h:83:40: note: in definition of macro ‘DISPATCHER_EXPOSED_PREFIX’
 #define DISPATCHER_EXPOSED_PREFIX(fnc) fnc
                                        ^~~
src/mfx_exposed_functions_list.h:54:1: note: in expansion of macro ‘FUNCTION’
 FUNCTION(mfxStatus, MFXVideoCORE_SetHandle, (mfxSession session, mfxHandleType type, mfxHDL hdl), (session, type, hdl))
 ^~~~~~~~
src/main.cpp:905:11: note: ‘mfxStatus MFXVideoCORE_SetHandle(mfxSession, mfxHandleType, mfxHDL)’ previously defined here
 mfxStatus MFXVideoCORE_SetHandle(mfxSession session, mfxHandleType type, mfxHDL hdl)
           ^~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:670: src/libmfx_la-main.lo] Error 1

This error is caused by git commit 8d25a2b5835908836bb03391f262d0bba24af13d (the last one at the time of writing). As you know, it was compiling perfectly one commit before this one.

Commands used:

$ git clone https://github.com/lu-zero/mfx_dispatch.git libmfx-git
$ cd libmfx-git
$ autoreconf -i
$ ./configure \
                --prefix=/usr \
                --enable-static=yes \
                --enable-shared=no \
                --enable-fast-install=yes \
                --with-libva_drm=yes \
                --with-libva_x11=yes \
                --with-pic
$ make -j1

System information:
OS: Arch Linux x86_64
libmfx: git master (currently at r42.8d25a2b)
GCC: 6.2.1
glibc: 2.24
libva: 1.7.2
CPU: Intel Haswell

Any help or comment would be appreciated.
Thank you.

I'm trying to compile...

I'm trying to compile:

autoreconf -i

libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4' 
libtoolize: copying file 'm4/ltoptions.m4' 
libtoolize: copying file 'm4/ltsugar.m4' 
libtoolize: copying file 'm4/ltversion.m4' 
libtoolize: copying file 'm4/lt~obsolete.m4' 
configure.ac:37: installing './compile' 
configure.ac:7: installing './config.guess' 
configure.ac:7: installing './config.sub' 
configure.ac:5: installing './install-sh' 
configure.ac:5: installing './missing' 
Makefile.am: installing './depcomp'

./configure --prefix=/usr

configure: loading site script /usr/share/config.site checking for a BSD-compatible install... /usr/bin/install -c 
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p 
checking for gawk... gawk 
checking whether make sets $(MAKE)... yes 
checking whether make supports nested variables... yes
checking build system type... x86_64-unknown-linux-gnu 
checking host system type... x86_64-unknown-linux-gnu 
checking for pkg-config... /usr/bin/pkg-config 
checking pkg-config is at least version 0.9.0... yes 
checking for LIBVA_DRM... yes 
checking for LIBVA_X11... yes 
checking for g++... g++ 
checking whether the C++ compiler works... yes 
checking for C++ compiler default output file name... a.out 
checking for suffix of executables... 
checking whether we are cross compiling... 
configure: error: in `/mnt/BIG/9/0/VDR.record/0/IntelQSV-libmfx_dispatch-GIT/mfx_dispatch': configure: error: cannot run C++ compiled programs.

If you meant to cross compile, use `--host'. See `config.log' for more details Command exited with non-zero status 1

Some error from config.log:

configure:3685: checking for C++ compiler version configure:3694: g++ --version >&5 g++ (Gentoo 4.9.3 p1.2, pie-0.6.2) 4.9.3 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  configure:3705: $? = 0 configure:3694: g++ -v >&5 Using built-in specs. COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3/g++ COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.3/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-4.9.3/work/gcc-4.9.3/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3 - -includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/man --infodir=/usr/share/gc c-data/x86_64-pc-linux-gnu/4.9.3/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/python --enable-langua ges=c,c++,java,objc,obj-c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https:// bugs.gentoo.org/ --with-pkgversion='Gentoo 4.9.3 p1.2, pie-0.6.2' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with- multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts --enable-lto --with-cloog --disable-is l-version-check --enable-libsanitizer Thread model: posix gcc version 4.9.3 (Gentoo 4.9.3 p1.2, pie-0.6.2) configure:3705: $? = 0 configure:3694: g++ -V >&5 g++: error: unrecognized command line option '-V' g++: fatal error: no input files compilation terminated. configure:3705: $? = 1 configure:3694: g++ -qversion >&5 g++: error: unrecognized command line option '-qversion' g++: fatal error: no input files compilation terminated. configure:3705: $? = 1 configure:3725: checking whether the C++ compiler works configure:3747: g++    conftest.cpp  >&5 configure:3751: $? = 0 configure:3799: result: yes configure:3802: checking for C++ compiler default output file name configure:3804: result: a.out configure:3810: checking for suffix of executables configure:3817: g++ -o conftest    conftest.cpp  >&5 configure:3821: $? = 0 configure:3843: result: configure:3865: checking whether we are cross compiling configure:3873: g++ -o conftest    conftest.cpp  >&5 configure:3877: $? = 0 configure:3884: ./conftest ./configure: line 3886: ./conftest: Permission denied configure:3888: $? = 126 configure:3895: error: in `/mnt/BIG/9/0/VDR.record/0/IntelQSV-libmfx_dispatch-GIT/mfx_dispatch': configure:3897: error: cannot run C++ compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details

What I'm doing wrong?

windows xp not working?

Hello, as a note, got this message under xp [?]
procedure entry point wfopen_s could not be located in msvcrt.dll or some odd.
Cheers!

Unknown encoder 'libmfx'

the system is CentOS7.1 x86-64. and the msdk is MediaServerStudioEssentials2015R6
i build libav from git: https://github.com/lu-zero/libav/tree/qsv
and build mfx_dispatch from git:https://github.com/lu-zero/mfx_dispatch.
when i ran the command:

$ avconv -y -i test.mp4 -f mpegts -vcodec libmfx ./main.ts   
avconv version 12_dev0, Copyright (c) 2000-2015 the Libav developers
  built on Nov 30 2015 21:59:52 with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 2011-06-28 10:42:20
  Duration: 00:02:31.34, start: 0.000000, bitrate: 599 kb/s
    Stream #0:0(und): Video: h264 (Main) [avc1 / 0x31637661]
      yuv420p, tv, smpte170m/smpte170m/bt709
      640x352, 549 kb/s
      23.98 fps, 24k tbn, 47.95 tbc (default)
    Metadata:
      creation_time   : 2011-06-28 10:42:20
    Stream #0:1(und): Audio: aac [mp4a / 0x6134706D]
      44100 Hz, stereo, fltp, 47 kb/s (default)
    Metadata:
      creation_time   : 2011-06-28 10:42:21
Unknown encoder 'libmfx'

but it can find the libmfx.so in /usr/local/lib

$ echo $LD_LIBRARY_PATH 
/usr/local/lib64:/usr/local/lib

$ ls /usr/local/lib
libavcodec.a   libavformat.a    libmfx.a   libmfx.so.0      libpython2.6.so.1.0  python2.6
libavdevice.a  libavresample.a  libmfx.la  libmfx.so.0.0.0  libswscale.a         libavfilter.a  libavutil.a      libmfx.so  libpython2.6.so  pkgconfig

i also try the command on https://github.com/lu-zero/mfx_dispatch/wiki/Libav-integration
it occur:

$ ./avconv -c:v h264_qsv -i test.mp4 -f null -     
avconv version 12_dev0, Copyright (c) 2000-2015 the Libav developers
  built on Nov 30 2015 21:59:52 with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)
Unknown decoder 'h264_qsv'

the build for libav is:

./configure --enable-nonfree --enable-gpl --enable-version3 --enable-qsv --enable-memalign-hack
make; make install

for mfx_dispatch is:

autoreconf -i
./configure --enable-shared 
make -j
make install

i don't know why, and thanks for give me some help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.