Skip to content

Streaming using Newtek NDI

NDI streaming requires the NDI runtime and the optional Datastead NDI Filters package, which can be downloaded from https://www.datastead.com/downloads/.

The installation of the Datastead NDI filters and of the NDI runtime is described in https://www.datastead.com/docs/ndi/installation.html.

Sample code to send a stream to the network:

VideoGrabber.VideoSource = ...
VideoGrabber.NDIName = "MYSTREAM";
VideoGrabber.NetworkStreaming = ns_NDI;
VideoGrabber.NetworkStreamingType = nst_VideoStreaming; // or nst_AudioVideoStreaming if audio needed
VideoGrabber.StartPreview();

E.g., if the video source is a Logitech C930e webcam:

VideoGrabber.VideoSource = vs_VideoCaptureDevice;
VideoGrabber.VideoDevice = VideoGrabber.VideoDeviceIndex ("Logitech Webcam C930e");
VideoGrabber.AudioDevice = VideoGrabber.AudioDeviceIndex ("Microphone (Logitech Webcam C930e)");
VideoGrabber.NDIName = "MYSTREAM";
VideoGrabber.NetworkStreaming = ns_NDI;
VideoGrabber.NetworkStreamingType = nst_AudioVideoStreaming;
VideoGrabber.StartPreview();

Sample code to play a stream from the network:

VideoGrabber.VideoSource = vs_VideoFileOrURL;
VideoGrabber.VideoSource_FileOrURL = "ndi://DESKTOP-5B66SBT (MYSTREAM)";
VideoGrabber.AudioDeviceRendering = true;
VideoGrabber.StartPreview();

Notes:

  • Replace "DESKTOP-5B66SBT" with the name of the computer that streams to the network, and "MYSTREAM" with the real stream name to use.
  • If the sender and receiver are on the same computer, the computer name can be replaced by "localhost", e.g.:

    VideoGrabber.VideoSource_FileOrURL = "ndi://localhost (MYSTREAM)";
    
  • The naming rules of the NDI sources, the bandwidth modes and the filter interfaces are detailed in the Datastead NDI Filters documentation.