Tag: UWP

Microsoft Media Foundation and HoloLens: Enabling Real-Time Video Communication

A customer approached us with a specific request: they needed a code snippet that could compress video into the H.264/AVC video format. Additionally, they were developing an application for the hashtag#Microsoft hashtag#HoloLens, which was the previous generation of hashtag#mixedreality headsets.

Upon closer examination, we realized that the purpose was to enable video encoding and decoding in a hashtag#lowlatency, hashtag#realtime, multi-party video conferencing application. The challenge lay in achieving this on low-powered hardware with its unique platform and limitations.

The HoloLens utilizes the Microsoft UWP platform, which typically allows developers to avoid rewriting software for different platform devices. However, in this particular case, adaptation was necessary. The only viable approach for handling real-time video was to leverage hardware-assisted video encoding and decoding through Microsoft Media Foundation.

These devices come equipped with specialized GPUs that share similarities with traditional desktop graphics adapters but also have their own distinct characteristics. Essentially, we developed a subsystem specifically tailored for Microsoft HoloLens 1, enabling real-time video capture, compression, decompression, seamless camera integration, hashtag#unity3d integration, and audio hardware support.

DRM-enabled streaming media playback bug with UWP MediaElement

Addition of another crazy thing into internal tooling uncovered new interesting bug. An application is creating audiovisual HLS (HTTP Live Streaming – adaptive streaming developed by Apple) stream on the fly now with Microsoft PlayReady DRM encryption attached. UWP samples offer a sample application for playback: PlayReady sample. The playback looks this: Oops, no video!…

Read the full article

1 GB limit for Windows::Storage::FileIO::ReadLinesAsync?

There seem to be a limit of 1GB for FileIO::ReadLinesAsync API even though documentation is silent on this. The exception message itself adds no clarity: WinRT originate error – 0x80070057 : ‘The parameter is incorrect.’. The function starts working well when the input file is slightly reduced in size (under 1050 MB).

Another API exception which should not have been thrown

From the documentation on StorageFolder.TryGetItemAsync(String) Method: Tries to get the file or folder with the specified name from the current folder. Returns null instead of raising a FileNotFoundException if the specified file or folder is not found. Exception thrown at 0x00007FFB06BDA799 (KernelBase.dll) in DownloadIssue.exe: WinRT originate error – 0x80070002 : ‘An item cannot be found with the specified name…

Read the full article

Best JSON and Base64 libraries for C++ and Windows

The application in previous post Is my system a hybrid (switchable) graphics system? is implemented in C++/WinRT, which I finally decided to give a try. For authoring and consuming Windows Runtime APIs using C++, there is C++/WinRT. This is Microsoft’s recommended replacement for the C++/CX language projection, and the Windows Runtime C++ Template Library (WRL). The real question…

Read the full article

Media Foundation API primitive styling of WinRT windows.mediaCodec

An interesting Media Foundation question on StackOverflow: Weird connection between CoInitializeSecurity() and Media Foundation Encoders A developer has reasons to discard standard COM security and go RPC_C_IMP_LEVEL_ANONYMOUS. Surprisingly this has effect on Windows Media Foundation API in the part of available codecs (Media Foundation Transforms). Sample code: CoInitializeSecurity line in the code above removes the…

Read the full article