intel / libvpl

Intel® Video Processing Library (Intel® VPL) API, dispatcher, and examples
https://intel.github.io/libvpl/
MIT License
284 stars 87 forks source link

MFXEnumImplementations() fails on non-logged in Windows or old processors #161

Closed nyanmisaka closed 1 month ago

nyanmisaka commented 1 month ago

With the support of VPL in FFmpeg 6+ and the deprecation of MSDK, we switched to using VPL loader to compile FFmpeg. But this has caused some problems on Windows. Our use case is a media server, so an interactive desktop environment is not required.

I traced the code in FFmpeg and found that it was MFXEnumImplementations() that did not find any impl and returned this error code, which is a function newly introduced in VPL loader. If we switch back to compiling FFmpeg with MSDK, users report that everything works fine.

In both cases, is this expected behavior in VPL, or is it a new issue? Thanks in advance.

grabbel commented 1 month ago

Unfortunately i get the same error running ffmpeg 6+ on a HD4600 with Hardware acceleration on windows.

[AVHWDeviceContext @ 0000021b7437b340] Using device 8086:0412 (Intel(R) HD Graphics 4600).

[AVHWDeviceContext @ 0000021b72d0b480] Error creating a MFX session: -9.

Device creation failed: -1313558101.

Failed to set value 'qsv=qs@dx11' for option 'init_hw_device': Unknown error occurred

Error parsing global options: Unknown error occurred

jonrecker commented 1 month ago

Thank you for the info. Haswell is not included in the current VPL support matrix (more info here) but as you noted may be loaded via MSDK.

We've not been able to reproduce the issue of running in a headless environment. If you run vpl-inspect in both scenarios, it will report all available VPL implementations. FFmpeg also applies multiple filters using MFXSetConfigFilterProperty(), and if none of the reported implementations match those filters then VPL will return MFX_ERR_NOT_FOUND.

nyanmisaka commented 1 month ago

Thank you for the info. Haswell is not included in the current VPL support matrix (more info here) but as you noted may be loaded via MSDK.

We've not been able to reproduce the issue of running in a headless environment. If you run vpl-inspect in both scenarios, it will report all available VPL implementations. FFmpeg also applies multiple filters using MFXSetConfigFilterProperty(), and if none of the reported implementations match those filters then VPL will return MFX_ERR_NOT_FOUND.

@jonrecker This is reported by our users. I also cannot reproduce the first problem on ARC GPU. But users confirmed that using MFXInit() / MFXInitEx() can fix this problem in their environment.

Therefore we added a patch in our FFmpeg to try to fallback to using MFXInit() when VPL initialization fails.

But I am not sure whether these deprecated functions will be removed soon. If not, can Intel's FFmpeg developers also submit similar patches upstream to alleviate the issue and avoid us maintaining two FFmpeg versions containing VPL and MSDK separately?

jonrecker commented 1 month ago

@nyanmisaka The functions marked deprecated are not expected to be removed until the next major version update (API 3.0). So MFXInit/Ex() will probably remain in the API for the foreseeable future.

nyanmisaka commented 1 month ago

@nyanmisaka The functions marked deprecated are not expected to be removed until the next major version update (API 3.0). So MFXInit/Ex() will probably remain in the API for the foreseeable future.

Thx for the info. So I think I'll keep this patch to resolve the issue.