I have a Media Foundation based video decoder that works with the HEVC Codec from Microsoft.
On my development machine it works just fine.
However, on our production machines (which are very locked down devices with integrated GPUs and no Internet connections), attempting to activate the single transform that is found (the HEVC one I want to use) fails.
The error code returned is:
0x800704CF - The network location cannot be reached.
Some investigations suggest this is because Media Foundation (or the HEVC Codec or something associated with it) is trying to connect to sls.update.microsoft.com. And if it can't do that, it fails the activation.
My question is: How can I stop this?
Or more specifically, because I probably can't stop this, how do I fool Media Foundation into thinking it has already tried and succeeded in connecting?
On my development machine, it doesn't look like Media Foundation is making this connection attempt every time the application starts - it appears to be a one time thing, so presumably there's a registry key being written that I can force/fake on our production machines.
I've been hunting through the registry on my development machine, but haven't located anything that could be related - yet. (Maybe someone knows where I should be looking?)
Or is there an official way to run Media Foundation on a machine with no Internet connection?
The 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.dllandmfH265Enc.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, and I get0x80072ee7(WININET_E_NAME_NOT_RESOLVED)...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:
This is what's displayed in the debugger output:
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.