KlakNDI Documentation

repository·main·Indexed 21 days ago

https://github.com/keijiro/klakndi

A Unity plugin (jp.keijiro.klak.ndi) for sending and receiving high-quality video streams over a local area network using the NDI (Network Device Interface) standard. It includes NdiSender for streaming from Game View, Cameras, or Textures, NdiReceiver for outputting streams to textures or renderers, and NdiFinder for source discovery. Supports Unity 2022.3+ across Windows, macOS, Linux, iOS, and Android.

Tokens
777
Snippets
2
Records
7
Agent score
25%

What's inside KlakNDI

  1. System Requirements and Platform Support

    main

    Requirements

    • Unity Version: 2022.3 or later.

    Supported Platforms

    • Windows: x64, D3D11/D3D12
    • macOS: x64 or arm64 (M1), Metal
    • Linux: x64, Vulkan
    • iOS: arm64, Metal (Requires NDI SDK for Xcode builds)
    • Android: arm64, Vulkan/OpenGL ES 3.x (Requires network permissions)
  2. Configure Android permissions for KlakNDI

    main

    To run KlakNDI on Android, you must manually add the following permissions to your AndroidManifest.xml by overriding the default manifest:

    • android.permission.INTERNET
    • android.permission.ACCESS_NETWORK_STATE
    • android.permission.CHANGE_WIFI_MULTICAST_STATE

    Refer to the AndroidManifest.xml located in URP/Assets/Plugins/Android/ in the sample project for a template.

  3. Known Limitations of KlakNDI

    main

    Technical Constraints

    • Frame Dimensions: Video frames should be multiples of 16x8. Using other dimensions may cause glitches on some mobile devices when using the Game View capture method.
    • Audio: KlakNDI does not support audio streaming.
  4. Use the NDI Sender component

    main

    The NdiSender component sends a video stream from a specified source over the network.

    Configuration Options

    • NDI Name: The name of the NDI endpoint (only available when using the Camera capture method).
    • Keep Alpha: Enable to include the alpha channel in the stream; disable to reduce bandwidth.
    • Capture Method:
      • Game View: Captures frames from the Unity Game View.
      • Camera: Captures frames from a specific camera (supports URP and HDRP only).
      • Texture: Captures frames from a texture asset or Render Texture.

    Scripting

    You can attach metadata to the stream via the .metadata C# property.

    // Example: Attaching metadata via script
    var sender = GetComponent<NdiSender>();
    sender.metadata = "your metadata string";
  5. Use the NDI Receiver component

    main

    The NdiReceiver component receives an NDI video stream and outputs it to a texture or renderer.

    Configuration Options

    • NDI Name: The name of the NDI source to receive. You can type the name manually or use the selector to pick from available sources.
    • Target Texture: A Render Texture asset where the received frames will be copied.
    • Target Renderer: A Renderer object whose texture property will be overridden by the incoming stream.

    Scripting

    You can extract metadata from the incoming stream using the .metadata C# property.

    // Example: Extracting metadata via script
    var receiver = GetComponent<NdiReceiver>();
    string data = receiver.metadata;