- Rust 98.4%
- Shell 1.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| src | ||
| .gitignore | ||
| .travis.yml | ||
| build.rs | ||
| Cargo.toml | ||
| libndi-get.sh | ||
| LICENSE | ||
| README.md | ||
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, andLIBRARY_PATHnotes (see below). libndi-get.sh: helper script to download and install the NDI SDK v6 runtime.- Rust warnings: explicit lifetime annotations in
ndi.rsandndisinkmeta.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.x–6.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).