jit.ndi - Externals for sending video/audio over the network

    Mar 28 2020 | 9:55 am
    Had this one in the 'should probably get this released soon' pile for quite a while but have now taken advantage of my current excess of free time to push it over the finish line. Above is a first version of my NDI package for Max, which allows you to send/receive jitter matrices and MSP signals over a network to/from any device which supports NDI.
    If you don't know what NDI is, it's a protocol created by NewTek for video/audio over IP. It has very high performance and low-latency, and there's a lot of reasonably cost-effective hardware which supports it natively (e.g. https://www.bird-dog.tv/studio-overview/). NewTek also sell a camera app for iOS (https://www.newtek.com/software/ndi-camera/) which is a very cheap way to get a wireless camera into your patch.
    Package is free for all and LGPL licensed. Have done moderate testing, but still could be a few fatal crashes in there so please be careful if using in anything important. The thing that's been tested least is the audio receiving side, if you're using this please let me know how it's working for you.

    • Mar 28 2020 | 10:38 am
      Amazing, Thank You!
    • Mar 28 2020 | 10:52 am
      David, Thx for this. Is the runtime for Windows only? Link is to .exe. file?
    • Mar 28 2020 | 10:57 am
      No there’s a mac runtime as well, I’ll update the link in a bit. If you download the Mac version of NDI tools it will install the runtime.
    • Mar 28 2020 | 11:05 am
      Cool, got the Mac runtime link from console. B
    • Mar 28 2020 | 4:27 pm
      Hello David, Avec mes plus sincères remerciements. imp, ndi, posistage... you're the man! H.
    • Mar 29 2020 | 10:47 am
      Thanks David! Don't hate me, but I'm just wondering... do you have any plans in implementing GL texture input/output for your externals?
    • Mar 29 2020 | 1:41 pm
      @LSKA So because it's network based, all NDI data has to go through the CPU. Therefore adding GL texture IO natively to the object wouldn't help much as essentially I'd have to implement a mechanism to convert the texture to/from a standard jitter matrix before it could be sent/received. Jitter already has this functionality via jit.gl.asyncread and jit.gl.texture objects, so there's not much point in me duplicating it. What I may do however is add an extra page to the help patchers showing how to do the texture conversion.
    • Mar 29 2020 | 2:43 pm
      @David You're right, I didn't think of that.
    • Mar 29 2020 | 4:30 pm
      This is great—looking forward to testing it out! I'm getting 'no such object' for jit.ndi.send~.... I've installed the runtime for Mac and the NDI tools. Do I need another step to convert the vcxproj files?
    • Mar 29 2020 | 4:38 pm
      @antialias Looks like you've downloaded the source code rather than the compiled objects, this is the download you need.
    • Mar 29 2020 | 4:44 pm
      Thanks David!
    • Mar 30 2020 | 2:52 am
    • Mar 30 2020 | 12:08 pm
      Superb! I used it with the NDI Syphon, great that this extra step isn't necessary anymore. But unfortunately i don't get the external running, i still get the message in the Max window: "Unable to load NDI runtime library. Please download and/or reinstall NDI runtime from 'http://new.tk/NDIRedistV4Apple' and restart Max" I have done this and installed also NewTekNDIHXDriverForMacOS, NewTekNDIToolsForMacOS and libNDI_for_Mac.pkg Is there anything i forgot or can check to get it working? Max 8.1.3 MacOS 10.14.6 Thanks in advance!
    • Mar 30 2020 | 1:24 pm
      @Aartcore Have you restarted your system since installing? If not try that. Otherwise could you run find /usr/local/lib -name libndi.4.dylib in the terminal and post the result?
    • Mar 30 2020 | 1:38 pm
      Yes tried also restarting. terminal found the file: /usr/local/lib/libndi.4.dylib (file date is 26 march 2020) NDI is also working on my computer, for instance the NewTek NDI Scan Converter sends the image to NDISyphon btw. when i load the jit.ndi.receive~ or send object i get the message 6 times: "Unable to load NDI runtime library. Please download and/or reinstall NDI runtime from 'http://new.tk/NDIRedistV4Apple' and restart Max" may be this could be helpful in solving the problem?
    • Mar 30 2020 | 5:10 pm
      @Aartcore I've checked my code for loading the library and it's exactly as detailed in the SDK example. Could you try completely removing all NDI installations and files from your system and reinstall just the runtime from http://new.tk/NDIRedistV4Apple? Check that all version of libndi are removed from /usr/local/libfirst.
    • Mar 31 2020 | 9:41 am
      Hi David, i tried it on another computer (without already NDI installed) and it worked without problems. Max 8.1.3 and an older MacOS HighSierra 10.13.6
      I tried to uninstall NDI, but unfortunately there is no uninstaller, so i removed all the files from Library>Application Support>NewTek and the /usr/local/lib/libndi.4.dylib (the only NDI related file in that folder i could find) After restarts and installing the drivers again it did't work... Are there any other locations i have to remove and reinstall the NDI drivers? It's clear it is something on my computer, conflicting with drivers or so..
    • Apr 01 2020 | 1:09 am
      @Aartcore Not sure of any other relevant locations. Essentially there's two steps to the loading process, finding the library file and then loading the named function. Would be interested to find out which of those is failing.
    • Apr 04 2020 | 4:55 am
      Thanks! This is great, have been working on some building-encompassing AV interactive art, NDI is far from perfect but is certainly handy! Bravo!
    • Apr 08 2020 | 9:00 pm
      hello david, is it possible to stream peer2peer (from max to max) with the NDI externals? like with netsend~ etc. ? thanks for any hints
    • Apr 08 2020 | 9:12 pm
      @klaus Yes the jit.ndi.receive object can receive from the jit.ndi.send object. Should likely have better performance than netsend as well.
    • Apr 08 2020 | 9:37 pm
      thanks for the quick reply. sounds great, but i did not find out how to from the help files. can i connect to an IP with jit.ndi.send~ ?
    • Apr 08 2020 | 9:44 pm
      @klaus NDI doesn’t work with IPs addresses directly. Sources get advertised on the local network using host name and source name. Set those two attributes on the receive object to match the send object.
    • Apr 08 2020 | 10:04 pm
      ah ok, thanks for clarifying this. so with a VPN it should work out of the house...will test this very soon.
    • Apr 09 2020 | 9:07 pm
      jit.NDI via VPN does not work out of the box. the VPN needs to be open for bonjour recognition (or such). any insights in how to setup this?
    • Apr 09 2020 | 9:16 pm
      @klaus NDI wasn't really designed to be used over the internet as the bandwidth requirement for an HD stream is pretty high (around 100 mbps). I know there are a couple of products that allow NDI routing over the web (for example), but the price is pretty high as they're quite pro-oriented.
    • Apr 09 2020 | 11:14 pm
      if we send jitter matrices like the bball.mov in the helpfile, is it blown up to HD ?
    • Apr 09 2020 | 11:17 pm
      @kalus Nope, the matrix is sent at the exact dimension it is when passed to the object.
    • Apr 13 2020 | 2:34 am
      Hi David, same issue as @aartcore when ever I instantiate the jit.ndi.receive~ I get this message Unable to load NDI runtime library. Please download and/or reinstall NDI runtime from 'http://new.tk/NDIRedistV4Apple' and restart Max
      I've downloaded the NDI runtime and installed, restarted my machine, still no success.
    • Apr 13 2020 | 2:36 am
      @Aaron seems everyone is having this issue apart from me. I have a github issue up for it now, https://github.com/impsnldavid/jit.ndi/issues/6, check there for updates or if you have any useful information to add.
    • Apr 23 2020 | 4:40 pm
      Thank you so much! I had stopped doing my regular search on this forum hoping that someone would be kind enough to come up with this.. util today. You made my day :) I will start testing.
    • Apr 27 2020 | 7:50 pm
      @Aarron I had the same problem as everyone. Got it working like a charm as soon as I have updated to Catalina.
    • May 13 2020 | 11:32 pm
      gonna try to use this to send my macbook's built-in camera to my windows machine.
    • May 23 2020 | 2:56 am
      Thanks to help from Rama and Todd Ingalls on the Max slack, the issue with loading the NDI runtime on Mojave seems resolved. Updated package below:
    • May 24 2020 | 7:13 pm
      Another new release, new features this time. jit.ndi.receive~ can now control NDI enabled PTZ cameras. Additionally jit.ndi.send~ can optionally act as a 'virtual PTZ' camera. This means that it will advertise the NDI source as having PTZ capability, and any received PTZ control data will be output from the object. You can then hook this up to whatever you want in Max. In the help patcher I've shown a basic example of interacting with a jit.gl scene.
    • May 25 2020 | 8:21 am
      Thanks for the update! It's working fine now on my computer!
    • Jun 03 2020 | 12:09 am
      Hi David, super useful externals!
      Quick question: I notice quite a long latency (maybe half a second) when using this with the NDI virtual camera -- is this something innate to NDI virtual camera or is it something we could tweak in the jit.ndi.send~ external?
    • Jun 03 2020 | 12:29 am
      @Graham Wakefield Shouldn't be, the control values are output immediately upon being received. Do you get the same result when testing on the same machine (ie via loopback)?
    • Jun 03 2020 | 3:08 am
      Thanks David!
      It *is* on the same machine... but, the system's wifi is on (it is part of a larger system in which other parts need internet access), so I guess it may be bouncing the video stream to the wifi router and back even for same-machine streams. I did notice in playing around that streaming between machines on the wifi network has the same latency as a single machine streaming to itself.
      Could there be a way to configure the jit.ndi externals to use a specific network, such as loopback, without disabling wifi? More generally, if there are several network providers on a machine (e.g. wifi, wired, loopback), how can we tell it which network device to use?
    • Jun 03 2020 | 3:29 am
      @Graham Wakefield
      NDI doesn't allow you to specify specific network adapters. It will actually try and use multiple network adapters (to increase bandwidth) as long as there is a route to the destination available. The only way to prevent NDI traffic on an adapter is to use the firewall specifically block access to certain ports.
      However I'd be very surprised if traffic is being routed via your wireless router as NDI should automatically use the loopback adapter in this circumstance. Try disabling your WiFi adapter and see if the result is any different.