Skip to content

NDI Source filter

Datastead NDI Source receives an NDI stream published on the local network and delivers it to a DirectShow graph.

Filter name Datastead NDI Source
CLSID {42CF8276-8A83-4516-B05C-6C0CAF698FF0}
Category DirectShow Filters
Pins Video and Audio, both output pins
Interfaces IDatasteadNDISource, IDatasteadNDISource2, IPersistStream

How it is used

  1. Add the filter to the graph.
  2. Query IDatasteadNDISource2 and call SetNDIName with the name of the source to receive (see NDI source names).
  3. Optionally call SetNDIConnectionTimeoutMs, SetNDIBandwidthType and EnableDisableStreams.
  4. Render the Video and/or Audio output pins and run the graph.

The connection to the NDI sender is opened when the graph is run: the filter discovers the source on the network, connects to it, and waits for the first video and audio frames in order to expose the corresponding media types. This is why the media types of the output pins are only known once a stream is actually available: connect the pins after the source name has been set.

Output formats

The video pin delivers the frames in the pixel format of the received stream, in a FORMAT_VideoInfo media type:

NDI FourCC DirectShow subtype
UYVY, UYVA MEDIASUBTYPE_UYVY
NV12 MEDIASUBTYPE_NV12
I420 MEDIASUBTYPE_I420
BGRA MEDIASUBTYPE_ARGB32
BGRX, RGBA, RGBX MEDIASUBTYPE_RGB32

The AvgTimePerFrame of the media type is computed from the frame rate announced by the sender (or 30 fps when the sender does not announce one).

The audio pin delivers PCM audio (FORMAT_WaveFormatEx), with the sample rate and the channel count of the received stream.

Bandwidth

SetNDIBandwidthType selects what the sender is asked to send:

Value NDI constant Effect
-10 NDIlib_recv_bandwidth_metadata_only metadata only: no audio, no video
10 NDIlib_recv_bandwidth_audio_only metadata and audio only
0 NDIlib_recv_bandwidth_lowest a low-resolution proxy stream, saving bandwidth
100 NDIlib_recv_bandwidth_highest the full-resolution stream (default)

EnableDisableStreams additionally selects, on the receiver side, which of the video, audio and data streams are processed. Disabling the audio when it is not needed makes the connection faster.

Timeout

SetNDIConnectionTimeoutMs sets how long the filter waits while looking for the source on the network and while waiting for its first frames. The default is 2500 ms. Increase it on a busy network, or when the sender is started at the same time as the receiver.