NDI backport for NRK's Server

I know that official Server has support for NDI but because of this bug I can’t use it in production, besides some performance issues (audio stuttering and drifting in 1080i5994).

Is there any chance for NDI to be backported into NRK’s 2.1.x fork?

I was testing Ianshade fork and it works very stable, very solid. It provides consumer AND producer Ndi. You can list all the actives ndi sources, you can play a ndi source over a layer. And you can configure interlaced ndi also. Only i can not stop or destroy an active ndi source. I have had audio problems and memory leaks also. This was solved removing the SYSTEM AUDIO
.

I’ll try to get a look into it, but the system audio bug you’re telling in some circumstances can be quite a deal breaking thing.

That fork by ianshade has since been merged into the main dev builds https://github.com/CasparCG/server/pull/1112, so those are likely better to use as they will have had some other fixes since then.

I did prototype porting that to the 2.1NRK, but havent thoroughly test or had any need to use it so I dont know how well it works.

I don’t mind to do some testing on it. I have a couple machines available to run whatever test is needed.

I don’t have time to produce a build until the weekend, but if you are able to yourself then this is the branch here https://github.com/Julusian/CasparCG-Server/tree/feature/ndi-port. From the commit messages, the main thing I wanted to test was that the video produced is smooth.

Active NDI can be distroyed using “Remove 1 ndi” but “Stop 1-layer” must be followed to prevent freeze frame and not to consume as and when that ndi is reproduced.

Thank You.

I try to run ndi with given link
NDI video is playing smooth but it’s blocking whenever I get warning messages of Decklink late scheduled.
I tested it on same machine like add NDI source and play it back on channel 2 also i’m getting Windows crash error after shutting down server and I think it is because of NDI library.

How can we get list of all active NDI sources?

In server 2.3, the amcp command, NDI LIST to view all those available in network.

1 Like

Thank you kdprasad

I haven’t yet tested @Julusian’s backport (a lot of work these days), but from what I’ve run so far with Server 2.3.x builds, performance is quite good as long as I don’t use any system-audio in my channels.

With that in mind, what really prevents me from using any Server 2.2.x and forward versions is this bug which seems to be fixed by this pull request but it hasn’t yet been merged. I use image-producer a lot in my production setup and many automations I have in place use absolute paths for content.

That being said, this tackles issues regarding my production setup at work, but in other places where I help to maintain the broadcasting workflow, system-audio is vital for their broadcasting setup, as they have no Decklink or Bluefish, so they’re using a secondary screen over HDMI for broadcasting.

I’ll be trying to build @Julusian’s branch these days and check how everything goes, but I really hope for 2.3.x to fix the issues so I can finally upgrade to it.

@Julusian, I can’t seem to be able to build Server so far. I’ve tried the entire week with different settings in VS2019 and I can’t get it to build. Do I need a particular VS version for building?
Scratch all that, I finally managed to build it! :smiley:

I also found out that 2.3.x versions changed the SEEK command values (frames vs. milliseconds?), which broke part of my workflow and get some playout quirks with RedCast OnTime.


I’m editing my post to tell that I managed to build @Julusian’s fork and after a bit of testing, the only thing that held back the build was screen-consumer's performance. It dropped/unsynced a lot of frames, but after I turned it off and worked with NDI only, no problem. Right here I have no Decklink for testing yet, but I don’t think it might pose any more trouble than NDI by itself.

Any test you need me to run @Julusian?

Well, after a few weeks I’ve done fairly enough testing to tell that everything works pretty well with this fork, save for a few things.

NDI performs well and it’s useful to use as a replacement for screen-consumer in some cases as it doesn’t perform properly in my machine. Although, to be fair, no screen-consumer behaves properly in my machine (i3-7350K, GTX 1660). Tested in production, NDI screen is way more performant and flexible, as it allows to dynamically open/close monitors, as well as selecting the channel source, given it’s setup properly.

A thing that has happened on my Server instances in production is that, for some reason, first start of Server yields a black screen and diagnostics log outputs, and no response from AMCP commands. I haven’t tested yet if that’s because of producers settings in my config file. So I have to take it down, reboot, and try again.

Also, system-audio consumers don’t seem to perform well too. This can be alleviated by using NDI Screen Monitor and setting its audio monitoring on, with the caveat of using NDI Tools 3.8 as discussed in this post. Tools available in this post.

So I’m up for anything now, @Julusian. If you need me to run any particular test, I’m all gears. :wink:

Thats great to hear.

Im really just interested to know if the output is smooth, the NDI studio monitor is a good test for that. Audio working is good, I definitely didn’t test that myself :slight_smile:
It would be good to know how smooth NDI input is, but I am happy to call that part experimental and merge it without that being very tested.

About the crashing at startup, what kind of diagnostic messages are being logged? Do you have a log file you could share of that happening?

[2019-11-29 21:03:27.907] [10796] [warning] DeckLink Duo 2 [2-3|1080i5994] late scheduled=5374387018* decklink=5374385865
[2019-11-29 21:03:27.908] [10796] [debug]   [diagnostics] [DeckLink Duo 2 [2-3|1080i5994]] late-frame [ch=2]
[2019-11-29 21:03:27.930] [10796] [warning] DeckLink Duo 2 [2-3|1080i5994] late scheduled=5374389020* decklink=5374386536
[2019-11-29 21:03:27.930] [10796] [debug]   [diagnostics] [DeckLink Duo 2 [2-3|1080i5994]] late-frame [ch=2]
[2019-11-29 21:03:27.966] [10796] [warning] DeckLink Duo 2 [2-3|1080i5994] late scheduled=5374391022* decklink=5374387609
[2019-11-29 21:03:27.966] [10796] [debug]   [diagnostics] [DeckLink Duo 2 [2-3|1080i5994]] late-frame [ch=2]
[2019-11-29 21:03:28.012] [10796] [warning] DeckLink Duo 2 [2-3|1080i5994] late scheduled=5374393024* decklink=5374388981
[2019-11-29 21:03:28.012] [10796] [debug]   [diagnostics] [DeckLink Duo 2 [2-3|1080i5994]] late-frame [ch=2]
[2019-11-29 21:03:28.636] [13732] [warning] DeckLink Duo 2 [1-4|1080i5994] late scheduled=5374411042* decklink=5374410609
[2019-11-29 21:03:28.636] [13732] [debug]   [diagnostics] [DeckLink Duo 2 [1-4|1080i5994]] late-frame [ch=1]
[2019-11-29 21:03:28.709] [13732] [warning] DeckLink Duo 2 [1-4|1080i5994] late scheduled=5374414045* decklink=5374412778
[2019-11-29 21:03:28.709] [13732] [debug]   [diagnostics] [DeckLink Duo 2 [1-4|1080i5994]] late-frame [ch=1]
[2019-11-29 21:03:28.731] [13732] [warning] DeckLink Duo 2 [1-4|1080i5994] late scheduled=5374416047* decklink=5374413444
[2019-11-29 21:03:28.731] [13732] [debug]   [diagnostics] [DeckLink Duo 2 [1-4|1080i5994]] late-frame [ch=1]
[2019-11-29 21:37:26.771] [13732] [warning] DeckLink Duo 2 [1-4|1080i5994] late scheduled=5435553123* decklink=5435551808
[2019-11-29 21:37:26.772] [13732] [debug]   [diagnostics] [DeckLink Duo 2 [1-4|1080i5994]] late-frame [ch=1]
[2019-11-29 21:37:26.804] [13732] [warning] DeckLink Duo 2 [1-4|1080i5994] late scheduled=5435555125* decklink=5435552811
[2019-11-29 21:37:26.804] [13732] [debug]   [diagnostics] [DeckLink Duo 2 [1-4|1080i5994]] late-frame [ch=1]
[2019-11-29 21:37:26.838] [13732] [warning] DeckLink Duo 2 [1-4|1080i5994] late scheduled=5435557127* decklink=5435553842
[2019-11-29 21:37:26.839] [13732] [debug]   [diagnostics] [DeckLink Duo 2 [1-4|1080i5994]] late-frame [ch=1]
[2019-11-29 21:37:26.906] [13732] [warning] DeckLink Duo 2 [1-4|1080i5994] late scheduled=5435560130* decklink=5435555856
[2019-11-29 21:37:26.906] [13732] [debug]   [diagnostics] [DeckLink Duo 2 [1-4|1080i5994]] late-frame [ch=1]

I’m having these messages, as well as audio stuttering while executing I/O operations in any HDD in the system while playing a file. My channels config is as follows:

  <channels>
    <channel>
      <video-mode>1080i5994</video-mode>
      <consumers>
        <decklink>
          <device>4</device>
          <key-device>2</key-device>
          <embedded-audio>true</embedded-audio>
          <latency>default</latency>
          <keyer>default</keyer>
          <key-only>false</key-only>
          <buffer-depth>3</buffer-depth>
        </decklink>
        <ndi>
          <name>Transmision-Aire</name>
          <allow-fields>false</allow-fields>
        </ndi>
      </consumers>
    </channel>
    <channel>
      <video-mode>1080i5994</video-mode>
      <consumers>
        <decklink>
          <device>3</device>
          <key-device>2</key-device>
          <embedded-audio>true</embedded-audio>
          <latency>normal</latency>
          <keyer>external</keyer>
          <key-only>false</key-only>
          <buffer-depth>3</buffer-depth>
        </decklink>
        <ndi>
          <name>Transmision-ATEM</name>
          <allow-fields>false</allow-fields>
        </ndi>
      </consumers>
    </channel>
    <channel>
      <video-mode>1080i5994</video-mode>
      <consumers>
        <decklink>
          <device>2</device>
          <key-device>2</key-device>
          <embedded-audio>true</embedded-audio>
          <latency>normal</latency>
          <keyer>external</keyer>
          <key-only>false</key-only>
          <buffer-depth>3</buffer-depth>
        </decklink>
        <ndi>
          <name>Transmision-Estudio</name>
          <allow-fields>false</allow-fields>
        </ndi>
      </consumers>
    </channel>
  </channels>

@julusian By the way, I tested NDI Producer commands, as of this pull request, but it seems it’s not implemented in this fork; only PLAY 1-10 [NDI] "DEVICE-NAME (Source Name)".