NewTek's innovative Network Device Interface (NDI) is a high performance standard that allows anyone to use real time, ultra low latency video on existing IP video networks.
I have a desktop application which already uses ImageView to display images and MediaView to display videos, but would like to add a "view" to display an NDI stream.
NewTek provide an SDK which supports Windows®, Linux®, and macOS™ and examples are provided for C#, C++ and VB.net.
My understanding from NDI SDK Documentation.pdf contained within the SDK is that I would have to use the NDI-Find library to identify all NDI streams on the network, selecting the desired stream to consume it using the NDI-Receive library.
I'm looking for guidance from this community as to whether the resources of the SDK can be used to create a desktop application to find and then display an NDI source using B4J. Or is it not possible or at least very difficult.
Incidentally, based on one of the VB.Net examples I've created my own NDI source and no doubt could achieve what I want in VB.Net, but I want to include the NDI display as an extension to an existing B4J application.
Just to give the community the flavour of the SDK library the following code will create an NDI-Find instance, and then list the current available sources. It uses NDIlib_find_wait_for_sources to sleep until new sources are found on the network and, when they are seen, it will call NDIlib_find_get_current_sources to get the current list of sources.
I have a desktop application which already uses ImageView to display images and MediaView to display videos, but would like to add a "view" to display an NDI stream.
NewTek provide an SDK which supports Windows®, Linux®, and macOS™ and examples are provided for C#, C++ and VB.net.
My understanding from NDI SDK Documentation.pdf contained within the SDK is that I would have to use the NDI-Find library to identify all NDI streams on the network, selecting the desired stream to consume it using the NDI-Receive library.
I'm looking for guidance from this community as to whether the resources of the SDK can be used to create a desktop application to find and then display an NDI source using B4J. Or is it not possible or at least very difficult.
Incidentally, based on one of the VB.Net examples I've created my own NDI source and no doubt could achieve what I want in VB.Net, but I want to include the NDI display as an extension to an existing B4J application.
Just to give the community the flavour of the SDK library the following code will create an NDI-Find instance, and then list the current available sources. It uses NDIlib_find_wait_for_sources to sleep until new sources are found on the network and, when they are seen, it will call NDIlib_find_get_current_sources to get the current list of sources.
B4X:
// Create the descriptor of the object to create
NDIlib_find_create_t find_create;
find_create.show_local_sources = true;
find_create.p_groups = nullptr;
// Create the instance
NDIlib_find_instance_t pFind = NDIlib_find_create_v2(&find_create);
if (!pFind) /* Error */;
while(true) // You would not loop forever of course !
{ // Wait up till 5 seconds to check for new sources to be added or removed
if (!NDIlib_find_wait_for_sources(pNDI_find, 5000))
{ // No new sources added !
printf("No change to the sources found.\n");
}
else
{ // Get the updated list of sources
uint32_t no_sources = 0;
const NDIlib_source_t* p_sources = NDIlib_find_get_current_sources(pNDI_find, &no_sources);
// Display all the sources.
printf("Network sources (%u found).\n", no_sources);
for (uint32_t i = 0; i < no_sources; i++)
printf("%u. %s\n", i + 1, p_sources[i].p_ndi_name);
}
}
// Destroy the finder when you’re all done finding things
NDIlib_find_destroy(pFind);
Last edited: