ARUWPVideo Options in HoloLensARToolKit v0.2

This post is part of documentation of HoloLensARToolKit, version v0.2.

ARUWPVideo

ARUWPVideo.cs is one of the main scripts used in HoloLensARToolKit. In this post, the options of this script are listed and discussed, along with common usecases.

Each Unity project using HoloLensARToolKit package must and must only have one ARUWPVideo component.

ARUWPVideo is unique to HoloLensARToolKit v0.2. In previous version: v0.1, the video pipeline is embedded in ARUWPController.cs, which inevitably made video capture and rendering in the same thread. Starting v0.2, the video pipeline uses APIs directly from Windows.Media.Capture, and is asynchronous with rendering and tracking.

When ARUWPVideo script is attached to some Unity GameObject, its inspector window looks like this:

Enable Video Preview

This field configures whether video preview is enabled. When it is checked, the video pipeline saves an additional copy of the bitmap, and renders to Unity Texture2D object when the next Update() function is called.

Video Preview Holder

This field will appear when Enable Video Preview is checked. Any object with a proper Renderer can be a preview holder. During runtime, the bitmap fetched from video pipeline will be drawn onto this object. In the sample scenes of HoloLensARToolKit, this field is a Quad object anchored to the top-left corner from user’s perspective, similar to a debugging windows.

Video FPS Holder (optional)

This field is looking for a Unity.UI.Text object to print out video frame rate. It is very useful for debugging, or inspecting the performance of the application. In the sample scenes provided by HoloLensARToolKit, this text field is at the top-right corner for the user. Because it is not a required component for tracking to run, this field can be left blank.

Also note that the maximum video preview rate that HoloLens supports is 30 fps. Really?

Finally

You can access more articles describing the implementation details of HoloLensARToolKit in my blog, simply clicking on the tag: hololens-artoolkit.

Thanks for reading!