KlakNDI is a NewTek NDI protocol plugin for Unity that allows sending/receiving video between multiple computers via a local area network. It provides a high quality, low latency and performant way to mix multiple video streams from several NDI-enabled applications and devices without the need of complex video capturing setups but only a wired/wireless network connection. The plugin is implemented to fully utilize the asynchronous GPU readback and custom texture update feature to achieve the optimal performance and the lowest latency in Unity.
NDI™ is a trademark of NewTek, Inc.
- Unity 2018.1 or later
- Windows 64-bit, Direct3D 11
KlakNDI is only available with D3D11 because it's the only environment that supports the GPU async readback functionality at the moment.
The current version of KlakNDI only included 64-bit (x64) binary DLLs. Please note that it doesn't work with 32-bit (x86) Unity players.
Download and import one of the .unitypackage files from Releases page.
The NDI Sender component (NdiSender
) is used to send rendered frames to
other NDI supported software/hardware via a network.
There are two modes in NDI Sender:
The NDI Sender component runs in the camera capture mode when attached to a camera object. It automatically captures frames rendered by the camera and publish them to the network. The dimensions of the frames are dependent on the screen/game view size.
Note that the camera capture mode is not compatible with scriptable render pipelines.
The NDI Sender component runs in the render texture mode when it's independent from any camera. To publish frames in this mode, a render texture should be specified via the Source Texture property. The NDI Sender component publishes the contents of the render texture every frame.
The NDI Sender component uses the UYVY format (4:2:2 subsampled color) by default, which is the most optimal setting to feed a video stream to the NDI library. By enabling the Alpha Support property, it can be switched to the UYVA format (4:2:2 color + alpha) that supports alpha channel. It requires an extra bandwidth and processing resources, so that it's recommended disabling when alpha channel is not actually needed.
The NDI Receiver component (NdiReceiver
) is used to receive frames published
by other NDI supported software/hardware via a network.
In case that multiple NDI sources (senders) exist in a network, the Name Filter property is used to determine which source should be connected. The NDI Receiver tries to connect to the first source whom name contains the string specified in the property. Note that this string matching is case-sensitive.
When nothing is specified in the Name Filter property, the NDI Receiver tries connecting to the first found source without string matching.
The NDI Receiver updates a render texture specified in the Target Texture property every frame. Note that the NDI Receiver doesn't care about aspect ratio; The dimensions of the render texture should be manually adjusted to avoid stretching.
When a renderer component (in most cases it may be a mesh renderer) is specified in the Target Renderer property, the NDI Receiver sets the received frames to one of the texture properties of the material used in the renderer. This is a convenient way to display received frames when they're only used in a single instance of renderer.
The received frames are also accessible via the receivedTexture
property of
the NdiReceiver
class. Note that the receivedTexture
object is
destroyed/recreated when the settings (e.g. screen size) are changed. It's
recommended updating the reference every frame.
The NDI source list view is a handy way to check what NDI sources are currently available in the network. To open the list view, from the application menu select "Window" - "Klak" - "NDI Source List". The list is updated even in the edit mode.
The NDI DLL file (Processing.NDI.Lib.x64.dll
) placed in the plugin internal
directory is provided by NewTek, Inc under the NDI® SDK License Agreement.
Please review the original license when distributing products with the plugin.