Skip to content

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

@zhaoye1

Description

@zhaoye1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions