7 April 2021

Unraid 6.9 Capture, Encoding, and Streaming Server

Want to utilize your server to capture, encode and stream to sites like Twitch or Youtube? This is an updated 2021 guide for setting up an OBS NDI container in Unraid 6.9.

Streaming server 1
This Guest Blog is by Stefano Partida of SPX Labs

This is the updated 2021 guide for setting up an OBS NDI container in Unraid 6.9. This guide is an update to the Multi-Streaming Server blog. This the perfect lightweight solution rather than using a virtual machine or a dedicated PC. Get more out of your Unraid server with those leftover system resources!

Let’s get started.

Versions

Unraid 6.9.1

Community Apps: 2021.03.12

Ich777 NVIDIA-Plugin: 2021.03.19

Nvidia Driver: 460.67

GPUs Tested with: P600 & k420

What is NDI?

NDI is a plugin that allows you to capture audio and video from a device and output that data to the network. A second system can then capture that audio and video output and transcode it to be sent off to some other streaming service like Twitch. This can all be done over your local network. No capture cards needed.

Basic Diagram

Here is a very simple visual representation of how this all works. Essentially, you are sending un-encoded video over the local network (using NDI) to your OBS container. Your OBS container then captures this video where then you can use a GPU or CPU to encode the video and send it off to Twitch or YouTube. The Unraid server will do all of the encoding instead of your gaming computer thus allowing you to have the maximum gaming performance possible.
 

Diagram

Guide

This guide assumes you have already installed the Community Apps plugin and have “Enable additional search results from dockerHub:” enabled. In short you can do this by going to Apps -> Settings -> Yes -> Apply.

Dockerhub Search
Daedilus Download

Install and Configure the obs-ndi Container

  1. Download and install the Daedilus1 docker obs container
  2. Edit the container and modify the following items:
    1. Set the Network type to custom: br0
    2. Assign it a useful IP
    3. Click the Advanced View button in the top right corner
    4. In the WebUI: section, add http://[IP]:[PORT:5901]
    5. Add the port 5901 and connection type of tcp
    6. Click Apply

Your configuration should look like this when you are done:

Obs Config Complete

Now you can go ahead and connect to the container with VNC in the WebUI. The password is 123456. It should look like this after you connect to it. Right-Clicking on the Desktop will reveal OBS in Ubuntu.

Congrats

Setup NDI on Both Machines

This guide assumes you have already downloaded and installed the NDI plugin for OBS Project.

On your gaming PC go to Tools -> NDI Output Settings -> Check mark the box for “Main Output”. It looks like this:

Gaming PC Setup

Now, on your Unraid server inside the container, you just need to add the NDI Source to the Sources box. The source name should be the hostname of your gaming PC, in this case, my gaming pc is named “Queenbootywhomp”. Don't ask.

Queenbootywhomp

Success!

From here you can play around with the settings as you see fit. While streaming to YouTube, this is how much CPU and RAM is being used for a 1920x1080p stream at 60FPS. You will definitely want to tweak your settings in accordance with your hardware.

Stats During Stream

Nvidia NVENC Encoding

While all of the above is cool and all, what if we want to use NVENC for Youtube or Twitch streaming instead?

I do have a spare Quadro or GeForce laying around. Luckily, it’s pretty simple now:

  1. In Community Apps search for Nvidia-Driver
  2. Download and install Ich777 Nvidia Driver
  3. Reboot
  4. After waiting patiently go to Plugins -> Nvidia Driver
  5. You will see that the plugin has automatically downloaded the driver for your graphics card. You will need to copy your GPU key from here. It should look like this picture below.
Nvidia Driver Plugin Page

Now that you have that copied we will need to go back to our container and add two variables and an extra parameter:

Nvidia_visible_devices

NVIDI Adevices

Nvidia_Driver_Capabilities

Nvidia Capabilities

Extra Parameters

Finally, all you need to do is add “—runtime=nvidia” to the extra parameters line and we are done. Your configuration should look similar to the one below.

Nvidia Done

Check OBS for NVENC

Okay time to make OBS use NVENC:

Nvidia OBS Done 1
Nvidia SMI

In the picture above, I am running the command “watch nvidia-smi” to see if the Quadro P600 is actually being used. As soon as you hit record or start stream “No running processes found” goes away but is not replaced with any PID or name. Could be a bug.

See All of This in Action

Troubleshooting

What if your NDI source is blank?

The NDI version of both the gaming pc and the container must be the same for this to work. If the NDI versions are different then there will be no Source. You can also try rebooting both machines, that helped me a couple of times.

I did not run into any other bugs.

Other Features

Can I Record Locally?

Yes. I’d also recommend setting a recording path in the container to something like /video. Then in Unraid setting up a Container Path of /Video to a Host Path of something like /mnt/cache/obs-ndi/video.

Third-Party Applications

Here is a brief list of 3rd party applications this setup does not work with. I may add more based on comments or other findings in the future.

  • NDI HX Camera - most likely an NDI compatibility issue.
  • SLOBS - To my knowledge SLOBS only receives NDI Output, as in, you can only add an incoming source not broadcast. Also, as far as I know, SLOBS is not Linux compatible. Such a shame. Please note I have not tested the following and it is mere speculation on my part.
    • You could get “crazy” with your set up and do OBS -> docker-obs-ndi -> nginx-rtmp-docker -> SLOBS VM -> Twitch/YouTube/Mixer/etc
    • Or maybe even OBS -> docker-obs-ndi -> SLOBS VM -> Twitch/Youtube/Mixer/etc

Conclusion

I don’t think there would be much of a difference in quality between newer GPUs (Pascal and newer). In the past, I have used K4000’s and the P600 and didn’t notice any differences. GTX 1060's or newer would also perform plenty well.

Look Interesting?

What are you streaming these days and what is your setup? Let us know in the forums!