search
Start typing to search...

How to Use Aximmetry as External Keyer with Unity

Author:

Introduction

This document explains how to transmit a keyed video from Aximmetry to the Unity Real-Time Development Platform. This can be achieved by keying the video in Aximmetry, then utilizing NDI output in Aximmetry and NDI input in Unity.

While Aximmetry has native NDI support, Unity does not. Therefore, this tutorial employs the KlankNDI package to handle the NDI signal within Unity.

NOTE: NDI I/O ports are limited to certain license types of Aximmetry or available via rental. You can learn more about this on our Products page.

Setting Up Aximmetry

Before you go to Unity, you have to start Aximmetry Composer.

On the Startup Configuration screen, drag and drop the NDI option into the 2nd Video Outputs slot: 

Now, in your Video Outputs, you have the NDI connection.  Set it to Sync to ensure that rendering (including keying) occurs at the same frame rate:

Click on the Video mode's field, and select your desired resolution and frame rate. All options are supported by the NDI standard. Also, make sure that the format is set to RGBA:

Create a simple flow for Chroma Keying.

Set up the keyer as said in the Using the keyer compounds in the flowgraph paragraph in the keying document.
And use a Video Input module to get the video from your camera device. Don't forget to set the Device and Mode values in the module.

NOTE: You can use any video or compound for testing purposes as long as you make sure that there is a video output at index #2.

Installing KlankNDI for Your Unity Project

KlankNDI is a package created by Keijiro Takahashi, and it is a package that you can download internally in Unity through the package manager. However, as this is an external package using "scoped registry", you need to do some extra steps to edit your Unity's Package Manager manifest file. You can find a detailed explanation of how to install it on Keijiros' GitHub. https://github.com/keijiro/KlakNDI

Setting Up Your Unity Project

Once you have installed the KlankNDI and have also added it to your Unity Project. Go to your Assets folder and create a "Render Texture". (In our example, it's simply called NDI.)

We suggest setting the Size of this Texture to 2048x2048 if you are sending FullHD video. As Unity rescales every non-square texture to a square texture of 2^ (256..1024..2048). In this way, you can get a bit better output as the system only rescales the texture once.

Create a Material. We name it simply Aximmetry.

Set it to Unlit/Transparent Cutout or Unlit/Transparent.

Select the previously created Render Texture as texture.

Create a Plane in the Scene.

Apply the material to it. (Drag and Drop material on the Plane.)

Create an empty GameObject. (Shortcut: CTRL + SHIFT + N)

Add a Component "NDI Receiver".

Choose the NDI stream you created in Aximmetry.

Apply your new "NDI" Render Texture as the Target Texture.

You should see the Aximmetry NDI output on your Plane. 

If you start your Chroma Keyed Aximmetry Project now. You will get the keyed output.

If you place this plane anywhere in your scene, this is your Billboard. 

You can use this method with HDRP Shaders as well. Please refer to Unity documentation for HDRP, URP, or SRP setup.

Article Content

Loading
Close
Loading spinner icon
1/10