GStreamer plugins written in Rust. *These plugins can be used by applications written in other programming languages as well of course, they are just like any other GStreamer plugins available on the system.*
Find a file
rubenrua 227080e32d Add comment about Newtek NDI times resolution
See: https://github.com/FFmpeg/FFmpeg/blob/master/libavdevice/libndi_newtek_common.h#L27

From NDI SDK Documentation:
This is the timecode of this frame in 100ns intervals. This is generally not used internally by the SDK, but is passed
through to applications who may interpret it as they wish. When sending data, a value of
NDIlib_send_timecode_synthesize can be specified (and should be the default), the operation of this value is
documented in the sending section of this documentation. NDIlib_send_timecode_synthesize will yield UTC
time in 100ns intervals since the Unix Time Epoch 1/1/1970 00:00. When interpreting this timecode a receiving
application may choose to localise the time of day based on time zone offset which can optionally be communicated by
the sender in connection metadata. Since timecode is stored in UTC within NDI, communicating timecode time of day for
non UTC time zones requires a translation
2018-09-27 10:18:54 +02:00
src Add comment about Newtek NDI times resolution 2018-09-27 10:18:54 +02:00
.gitignore Update .gitignore with gitignore.io 2018-09-22 09:53:36 +02:00
.travis.yml Update travis with slomo GStreamer version 2018-09-25 13:50:49 +02:00
Cargo.toml Publish code in Github 2018-09-18 13:39:34 +02:00
LICENSE Add License and Acknowledgments 2018-09-25 12:07:55 +02:00
README.md Use "cargo build --release" in README. Fix #4 2018-09-25 15:55:54 +02:00

GStreamer NDI Plugin for Linux

Compiled and tested with Ubuntu 16.04.5, GStreamer 1.8.3 and NDI SDK 3.0.9 and 3.5.1

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 two source elements, ndivideosrc to get video from the stream and ndiaudiosrc for audio. By just providing the name or the ip of the stream, all the information required from the stream is picked up automatically, such as resolution, framerate, audio channels, ...

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 ndivideosrc
gst-inspect-1.0 ndiaudiosrc

#Video pipeline
gst-launch-1.0 ndivideosrc stream-name="GC-DEV2 (OBS)" ! autovideosink
#Audio pipeline
gst-launch-1.0 ndiaudiosrc stream-name="GC-DEV2 (OBS)" ! autoaudiosink

#Video and audio pipeline
gst-launch-1.0 ndivideosrc stream-name="GC-DEV2 (OBS)" ! autovideosink ndiaudiosrc stream-name="GC-DEV2 (OBS)" ! autoaudiosink

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

To compile the NDI element it's necessary to install Rust, the NDI SDK and the following packages for gstreamer:

apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
      gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
      gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
      gstreamer1.0-libav libgstrtspserver-1.0-dev

To install the required NDI library there are two options:

  1. Download NDI SDK from NDI website and move the library to the correct location.
  2. Use a deb package made by the community. Thanks to NDI plugin for OBS.

To install Rust, you can follow their documentation: https://www.rust-lang.org/en-US/install.html

Once all requirements are met, you can build the plugin by executing the following command from the project root folder:

cargo build
export GST_PLUGIN_PATH=`pwd`/target/debug
gst-inspect-1.0 ndi

If all went ok, you should see info related to the NDI element. To make the plugin available without using GST_PLUGIN_PATH it's necessary to copy the plugin to the gstreamer plugins folder.

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

More info about GStreamer plugins written in Rust:

https://github.com/sdroege/gstreamer-rs https://github.com/sdroege/gst-plugin-rs

https://coaxion.net/blog/2018/01/how-to-write-gstreamer-elements-in-rust-part-1-a-video-filter-for-converting-rgb-to-grayscale/ https://coaxion.net/blog/2018/02/how-to-write-gstreamer-elements-in-rust-part-2-a-raw-audio-sine-wave-source/

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).