-
Notifications
You must be signed in to change notification settings - Fork 58
NDI
Since UltraGrid version 1.7.2, binary builds include NDI®. NDI library is dynamically loaded, therefore you need to have the NDI runtime installed, for macOS and Windows the simplest way is to get it together with NDI tools:
- macOS and Windows: https://ndi.video/type/ndi-tools/
- Linux - NDI doesn't provide NDI Tools so you need to download the SDK and follow the installation instructions below
After the installation system reboot is recommended for the environment values to reload.
If a firewall is filtering the traffic, you'll need to allow the traffic.
You'd need to allow following recv ports (assuming that outgoing traffic is not filtered) for UltraGrid to work:
- Sender (NDI display) - TCP/5960-6000
- Receiver (NDI capture) - UDP/5960-6000
- (optional) for discovery (both sides) - UDP/5353 (for DNS-SD - its absence can be circumvented by using extra_ips= vidcap parameters, see extra_ips)
(The range for port numbers from 5960 is somewhat arbitrary, just few ports starting with 5960 may be sufficient for the stream but 40 port above was chosen as a margin of safety.)
(Complete listing of ports used by NDI can be found here.)
Basic usage is simply:
uv -t ndi -c <compression> [-s embedded --audio-codec <ac>] <receiver>
The above command picks first source found on a local network and sends the data to the receiver.
You may also specify name (in form "MACHINE (source)") and/or URL (either in form ip_addr or ip_addr:port, exact URL format may change with future NDI releases) to capture from, eg.:
uv -t "ndi:name=HD10 (DeckLink 4K Extreme)" -c JPEG ultragrid-receiver.example.net
uv -t "ndi:name=uv" # source can be specified without MACHINE
uv -t "ndi:name=HD10" # vice versa - MACHINE without explicit service
uv -t ndi:url=192.0.2.15 -c JPEG ultragrid-receiver.example.net
uv -t ndi:url=192.0.2.15:5961 -c JPEG ultragrid-receiver.example.net
Note: the apostrophes in the first command are because the resource name contains spaces
You can also let UltraGrid discover available sources on a local network:
uv -t ndi:help
(The list doesn't need to be complete - UltraGrid waits only limited amount of time to response. If DNS-SD is not operable, see extra_ips below.)
If you want to capture including alpha channel, select a mode that captures RGBA (alpha is currently stripped from YCbCr formats):
uv -t ndi:color=0 # BGRX_BGRA; 1 (UYVY_BGRA), 2 (RGBX_RGBA), 3 (UYVY_RGBA) are also ok; default is however 100 (best)
Note: Very few of compressions support alpha-channel compression, one exception is GPUJPEG.
NDI video capture is capable of capturing video alongside with audio as usual:
uv -t ndi -s embedded -c libavcodec --audio-codec OPUS ultragrid-receiver.example.net
If the NDI source is audio only, it is possible to capture the audio with the NDI vidcap module even in the absence of video signal:
uv -t ndi:name=mic -s embedded --audio-codec OPUS ultragrid-receiver.example.net # if "mic" is audio only NDI source, no video is sent
If service discovery (DNS-SD) isn't working or is filtered, you'd need to use a parameter :extra_ips
to explicitly specify the sender IP address(es) to be probed, examples:
uv -t ndi:extra_ips=10.0.1.24:help # server listing running on 10.0.1.24
uv -t ndi:extra_ips=10.0.1.24,10.0.1.25:help # multiple addresses can be specified as well
uv -t ndi:extra_ips=10.0.1.24:name=uv # capture NDI sender named "uv" send with 10.0.1.24
Note: If DNS-SD is required, in Linux Avahi is required to be run for NDI DNS-SD to work.
Basic usage is quite usual:
uv -d ndi[:name=<n>] [-r embedded] <sender>
Analogically to the capture, the NDI display can also playback the audio without a video.
This step is required to add run-time dependency, for compilation see here.
Installation steps:
-
download and extract the installer:
tar xaf Install_NDI_SDK_v6_Linux.tar.gz
-
install the NDI
./Install_NDI_SDK_v6_Linux.sh
-
this creates directory
"NDI SDK for Linux"
directory in current path -
make the contained library
libndi.so.6
visible to UltraGrid, this can be done in two ways:-
copy (as root) libraries to
/usr/local/lib
:cp -a NDI\ SDK\ for\ Linux/lib/x86_64-linux-gnu/lib* /usr/local/lib/ cp -a NDI\ SDK\ for\ Linux/include/* /usr/local/include/ # (headers optional, can be omitted)
-
or export path to the library before running UG (or to system environment):
export NDI_RUNTIME_DIR_V6=<NDI_SDK_root>/lib/x86_64-linux-gnu/lib/ ./UltraGrid*AppImage [...]
-
[1] NDI® is a registered trademark of NewTek, Inc.
[2] NDI® is available at http://ndi.tv/
If you have any technical or non-technical question or suggestion please feel free to contact us at