NDI source names
On the network, an NDI source is identified by a name built by NDI itself as:
COMPUTERNAME (STREAMNAME)
where COMPUTERNAME is the name of the machine that publishes the stream and STREAMNAME is the name chosen by the sending application. Both the Datastead NDI Sink and the Datastead NDI Source work with that convention.
When sending
The sender only chooses the stream name: SetNDIName on the NDI Sink filter, or NDIName in TVideoGrabber. NDI prepends the computer name.
Setting MYSTREAM on a machine named DESKTOP-5B66SBT therefore publishes:
DESKTOP-5B66SBT (MYSTREAM)
When no name is set, the stream is published under the default name DATASTEAD_UNNAMED_SOURCE.
When receiving
The name given to the NDI Source filter (SetNDIName, or the ndi:// URL in TVideoGrabber) accepts three forms:
| Form | Meaning |
|---|---|
DESKTOP-5B66SBT (MYSTREAM) |
full name: exactly this stream, on exactly this machine |
(MYSTREAM) |
the first source found on the network whose stream name is MYSTREAM, whatever the machine |
localhost (MYSTREAM) |
localhost is replaced by the name of the local computer: the stream published by this machine |
The filter first looks for an exact match of the full name, then falls back to matching the stream name alone. The search runs until the source is found or the connection timeout expires (see SetNDIConnectionTimeoutMs, default 2500 ms).
The ndi:// prefix belongs to TVideoGrabber
ndi://DESKTOP-5B66SBT (MYSTREAM) is the URL form used by the TVideoGrabber VideoSource_FileOrURL property: TVideoGrabber recognizes the scheme, inserts the NDI Source filter and passes the name to it. A DirectShow application calls SetNDIName with the name alone, without the ndi:// prefix.
Listing the sources available on the network
Rather than hard-coding a name, an application can enumerate the sources currently published: GetNDISessionsList returns the list, as plain text or as XML, optionally with the URL (IP address and port) of each source. See Interface reference.