No description
  • Rust 98.4%
  • Shell 1.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-06-12 10:36:21 +02:00
src update repo with new coe and readme 2026-06-12 10:36:21 +02:00
.gitignore Update .gitignore with gitignore.io 2018-09-22 09:53:36 +02:00
.travis.yml Fix travis CI 2019-07-30 17:29:42 +02:00
build.rs Update to gstreamer-rs 0.17 2021-09-13 13:43:31 +03:00
Cargo.toml Update to gstreamer-rs 0.18 2022-01-22 12:12:03 +02:00
libndi-get.sh update repo with new coe and readme 2026-06-12 10:36:21 +02:00
LICENSE Update license (fix #22) 2019-03-18 18:24:37 +01:00
README.md update repo with new coe and readme 2026-06-12 10:36:21 +02:00

GStreamer NDI Plugin for Linux

Fork of teltek/gst-plugin-ndi. Upstream is largely unmaintained; this repository carries bugfixes and improved build tooling on top of the original Teltek plugin.

Compiled and tested with NDI SDK 4.0, 4.1, 5.0 and 6.x.

Changes from upstream

  • UYVY line stride fix (src/receiver.rs): copy only active pixel bytes per line (&src[..line_bytes]) instead of the full NDI-padded stride. Fixes a panic on non-standard widths (e.g. 100×240) where stride (224) exceeds line width (200).
  • Build docs: expanded prerequisites, pkg-config / NDI SDK verification, and LIBRARY_PATH notes (see below).
  • libndi-get.sh: helper script to download and install the NDI SDK v6 runtime.
  • Rust warnings: explicit lifetime annotations in ndi.rs and ndisinkmeta.rs.

This is a plugin for the GStreamer multimedia framework that allows GStreamer to receive a stream from a NDI source. This plugin has been developed by Teltek and was funded by the University of the Arts London and The University of Manchester.

Currently the plugin has a source element for receiving from NDI sources, a sink element to provide an NDI source and a device provider for discovering NDI sources on the network.

Some examples of how to use these elements from the command line:

# Information about the elements
$ gst-inspect-1.0 ndi
$ gst-inspect-1.0 ndisrc
$ gst-inspect-1.0 ndisink

# Discover all NDI sources on the network
$ gst-device-monitor-1.0 -f Source/Network:application/x-ndi

# Audio/Video source pipeline
$ gst-launch-1.0 ndisrc ndi-name="GC-DEV2 (OBS)" ! ndisrcdemux name=demux   demux.video ! queue ! videoconvert ! autovideosink  demux.audio ! queue ! audioconvert ! autoaudiosink

# Audio/Video sink pipeline
$ gst-launch-1.0 videotestsrc is-live=true ! video/x-raw,format=UYVY ! ndisinkcombiner name=combiner ! ndisink ndi-name="My NDI source"  audiotestsrc is-live=true ! combiner.audio

Feel free to contribute to this project. Some ways you can contribute are:

  • Testing with more hardware and software and reporting bugs
  • Doing pull requests.

Compilation of the NDI element

Prerequisites

Requirement Notes
Rust (1.70+) cargo and rustc on PATH
NDI SDK (4.x6.x) libndi.so must be installed and visible to the linker
GStreamer ≥ 1.18 Runtime + development headers (*.pc files for pkg-config)
pkg-config Used by the Rust GStreamer bindings at build time

1. System packages (Ubuntu / Debian)

Runtime packages alone are not enough — you need the -dev packages so pkg-config can find gstreamer-1.0 and gstreamer-base-1.0:

sudo apt update
sudo apt install -y \
  build-essential \
  pkg-config \
  libgstreamer1.0-dev \
  libgstreamer-plugins-base1.0-dev \
  gstreamer1.0-plugins-base \
  gstreamer1.0-tools

Verify pkg-config can see GStreamer:

pkg-config --modversion gstreamer-1.0 gstreamer-base-1.0

2. NDI SDK

Run libndi-get.sh from the repository root. It downloads NDI SDK v6 from ndi.tv, extracts it, and optionally installs libndi to /usr/local/lib (including a libndi.so.5 symlink for older plugins).

# Download and extract only (libs left in a temp dir for manual copy)
./libndi-get.sh

# Download, extract, and install to /usr/local/lib (recommended)
./libndi-get.sh install

Confirm the linker can find the library:

ldconfig -p | grep libndi
# e.g. libndi.so.6 => /usr/local/lib/libndi.so.6

Alternative — community .deb package

Use a packaged libndi build, for example from DistroAV.

If you install NDI somewhere other than /usr/local/lib, set LIBRARY_PATH when building (see below).

3. Rust

Install via rustup:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
rustc --version

4. Build

Clone this repository, then from its root:

source "$HOME/.cargo/env"   # if not already in PATH

# NDI libs are usually in /usr/local/lib; set this if yours are elsewhere
export LIBRARY_PATH=/usr/local/lib

# Debug build (load via GST_PLUGIN_PATH)
cargo build
export GST_PLUGIN_PATH="$(pwd)/target/debug"
gst-inspect-1.0 ndi

Release build and system-wide install:

cargo build --release

sudo install -o root -g root -m 644 \
  target/release/libgstndi.so \
  /usr/lib/x86_64-linux-gnu/gstreamer-1.0/

sudo ldconfig
gst-inspect-1.0 ndi

On aarch64, replace the install path with /usr/lib/aarch64-linux-gnu/gstreamer-1.0/.

By default GStreamer 1.18 is required. To target an older version, build with cargo build --no-default-features --features <feature_flags> (see Cargo.toml).

More info about GStreamer plugins written in Rust:

https://gitlab.freedesktop.org/gstreamer/gstreamer-rs https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs

License

This plugin is licensed under the LGPL - see the LICENSE file for details

Acknowledgments

  • University of the Arts London and The University of Manchester.
  • Sebastian Dröge (@sdroege).