Media Foundation cannot initialise H.265 / HEVC Video Decoder transform (cannot connect to Windows Update)
See the question and my original answer on StackOverflowThe H.265 / HEVC Video Decoder is in fact available through a Microsoft Windows Store application named HEVC Video Extensions (installed in %ProgramFiles%\WindowsApps\Microsoft.HEVCVideoExtension...
). It consists today of two binaries: HEVCDECODER_STORE.dll
and mfH265Enc.dll
.
Note this is not a free application. There used to also exist a 'HEVC from Device Manufacturer' that has disappeared from the store that was free. It's not clear the exact technical differences between the two, that may be due to HEVC licensing issues (see High Efficiency Video Coding).
On a Windows installation where this "application" has never been installed, it will try to contact Microsoft licensing server. If the server cannot be contacted because you don't have an available Internet connection, this step will fail. This is where you may get the 0x800704CF
(ERROR_NETWORK_UNREACHABLE
) error, or 0x80072ee7
(WININET_E_NAME_NOT_RESOLVED
), or something else related to a network issue...
Note if you installed it once, then the license seems to stay even if you uninstall the application afterwards.
The licensing issue can be seen while debugging a simple application using the HEVC Media Foundation IMFActivate interface and trying to use it like this:
IMFActivate* hevcActivate ... gotten from somewhere
IMFTransform* hevcTransform;
hevcActivate->QueryInterface(IID_IMFTransform, (void**)&hevcTransform);
This is what's displayed in the debugger output:
...
ModLoad: 00007fff`71d10000 00007fff`71f47000 C:\Windows\System32\Windows.ApplicationModel.Store.dll
ModLoad: 00007fff`bdad0000 00007fff`bdaf9000 C:\Windows\System32\Cabinet.dll
ModLoad: 00007fff`bac20000 00007fff`baedc000 C:\Windows\System32\iertutil.dll
ModLoad: 00007fff`a3970000 00007fff`a3ac3000 C:\Windows\System32\webservices.dll
ModLoad: 00007fff`be070000 00007fff`be17a000 C:\Windows\System32\WINHTTP.dll
info:Setting MSA Client Id for Token requests: {f0c62012-2cef-4831-b1f7-930682874c86} (0x80004005) [WinStoreAuth::AuthenticationInternal::SetMsaClientId]
onecoreuap\enduser\winstore\auth\lib\winstoreauth.cpp(267)\Windows.ApplicationModel.Store.dll!00007FFF71D16DBE: (caller: 00007FFF71E3465F) LogHr(1) tid(148c) 80004005 Unspecified error
Msg:[Setting MSA Client Id for Token requests: {f0c62012-2cef-4831-b1f7-930682874c86}] [WinStoreAuth::AuthenticationInternal::SetMsaClientId]
info:Windows::Services::Store::StoreContextFactory::GetDefault() invoked. (CV:5TroTyea8UKFylH5.2) [Windows::Services::Store::StoreContextFactory::GetDefault]
ModLoad: 00007fff`bf2c0000 00007fff`bfa90000 C:\Windows\System32\OneCoreUAPCommonProxyStub.dll
info:StoreContextServer::Initialize: packageFullName = , productStoreId = , isLicensed = false, isAppContainer = false [Windows::Services::Store::Internal::StoreContextServer::Initialize]
info:Windows::Services::Store::StoreContext::AcquireStoreLicenseForOptionalPackageAsync invoked. (CV:5TroTyea8UKFylH5.2.3) [Windows::Services::Store::StoreContext::AcquireStoreLicenseForOptionalPackageAsync]
ERROR: (0x80070057) [ClientProcessUtils::GetCallingAppPackageFamilyName]
ModLoad: 00007fff`bd2a0000 00007fff`bd2b6000 C:\Windows\SYSTEM32\usermgrcli.dll
(c98.1ac4): Unknown exception - code 80072ee7 (first chance)
ERROR:ChkHr(hr) (0x80072ee7) [Windows::Services::Store::Internal::StoreContextServer::AcquireStoreLicenseForOptionalPackage]
ERROR:ChkHr(storeContextServer->AcquireStoreLicenseForOptionalPackage( optionalPfn.Get(), spStorePackageLicenseLostCallback.Get(), &_valid)) (0x80072ee7) [Windows::Services::Store::StorePackageLicense::RuntimeClassInitialize]
ERROR: (0x80070057) [ClientProcessUtils::GetCallingAppPackageFamilyName]
ERROR:ChkHr(MakeAndInitialize<StorePackageLicense>( &_pStorePackageLicense, _pOptionalPackage.Get(), _storeContext.Get() )) (0x80072ee7) [Windows::Services::Store::AcquireStoreLicenseForOptionalPackageOperation::DoWork]
(c98.148c): CLR exception - code e0434352 (first chance)
ModLoad: 00007fff`71cc0000 00007fff`71d0c000 C:\Program Files\WindowsApps\Microsoft.WebpImageExtension_1.1.522.0_x64__8wekyb3d8bbwe\x64\mswebp_store.dll
(c98.148c): C++ EH exception - code e06d7363 (first chance)
...
We see that underlying code uses the StoreContext.AcquireStoreLicenseForOptionalPackageAsync WinRT's method and fails with ERROR:ChkHr(hr) (0x80072ee7)
.
So, it's a licensing issue. Maybe it's possible to distribute this package offline, this is a hint Distribute offline apps, not sure how/if it works, I've not tested this.