Seting up a Stream

Setting up a Stream #

Stream type considerations #

nuplayer is able to stream from RTSP, RTMP, HLS, NDI® and remote file sources. Each type is suited for different playback scenarios and has advantages/disadvantages. The following three protocols are best suited for LAN applications and offer low-latency video streaming without any internet connection:

RTSP (Real Time Streaming Protocl)

  • TCP/UDP transport
  • can be multicasted
  • low latency (depends but somewhere between 1-5 seconds)
  • good for low bandwidth scenarios
  • needs a server to let nuplayer stream from

RTMP (Real Time Media Transport)

  • TCP only, thus no multicast
  • low latency but higher than RTSP
  • less versatile and less efficient than RTSP
  • slightly more robust stream because of TCP
  • unusual to use it this way, as it is mostly being pushed to an endpoint nowadays and not pulled
  • pretty much a dead protocol, but widely adpoted by streaming encoders
  • needs a server as well

NDI® (Network Device Interface)

  • very high quality
  • very low latency
  • very high bandwidth consumption
  • can be multicasted

nuplayer can also play HLS streams. Obviously these can also exist in LAN and played back locally, but for the most part, HLS streams are an internet application.

HLS (HTTP Live Streaming)

  • possible need of an internet connection
  • high latency
  • wide variation in quality and resolution, depending on the source
  • very large pool of content, even live TV program

Lastly, playing back remote files is possible, but not recommended as it only makes sense in a very niche application.

Creating a stream as a playback source #

To create a stream, click the ADD STREAM button in the MEDIAFILES window, then choose the type of stream you want to add. Consider the following example inputs:

Example input for an RTSP stream

Example input for an RTSP stream

In this example, we use a direct IP connection with a path to live-rtsp. The Port to connect to is standard 554. The input notation is <ip-or-hostname>/<path>.

Example input for an RTMP stream

Example input for an RTMP stream

In this example, we also use a direct IP connection with a path to live and a “key” = SysPOAk22. The Port to connect to is standard 1935. The input notation is <ip-or-hostname>/<path>/<key-or-name>.

RTMP streams are often delivered by setting a “key” or “name” for the stream. This effectively means that the key is being appended to the URL as a path. So for example an RTMP endpoint with the address rtmp://10.42.1.66:1935/live becomes in conjuction with a key = SysPOAk22 -> rtmp://10.42.1.66:1935/live/SysPOAk22
Example input for an HLS stream

Example input for an HLS stream

In this example, we connect over HTTPS to a .m3u8 playlist, which contains an HLS stream.

The URL stream type can also be a remote file for playback.
Fig. 4: Example input for an NDI® stream

Example input for an NDI® stream

This example is the simplest one, as setting up an NDI® stream is very easy. As soon as an NDI® source is present, it is automatically listed inside the popup-button. When there are more than one sources available, click the popup-button and choose from the list.

When everything is set, click Add and your stream will show in your MEDIAFILES. From here, you can add the stream to playlists the same way as any other file.

Creating an RTP multicast stream in nuplayer Server #

A multicast RTP stream has to be added by direct URL input in nuplayer Server, because the transport is a bit different. Regarding the example setup and address below, you would enter rtp://@239.1.2.3:4444 as URL input. (note the correct notation with @)

Example input for a multicasted RTP stream

Example input for a multicasted RTP stream

Things to consider … #

… regarding RTSP & RTMP #

Even though these protocols need a server for distribution of an ingress signal, often times there is no need for a dedicated machine other than the one running nuplayer Server. Free Software like “MediaMTX” makes it very easy to set up both an RTSP and RTMP server. Together with FFmpeg, you can also generate a signal from a video file for an RTSP-stream with a command like:

ffmpeg -re -stream_loop -1 -i "/path/to/videofile.mp4" -c:v libx264 -b:v 6000k -maxrate 6000k -bufsize 9000k -c:a aac -b:a 128k -tune zerolatency -preset veryfast -crf 23 -f rtsp -rtsp_transport udp rtsp://localhost:8554/rtsp-stream

which makes your stream locally available at port 8554 (default port used by MediaMTX) at a bitrate of 6MBit/s. You would have to use an address like <ip-of-mediamtx-machine>/rtsp-test or with regards on the examples above 10.42.1.66/rtsp-stream to add as a stream for nuplayer devices. You could also use OBS with a plugin to achieve the same.

… regarding NDI® #

No NDI® source has to be present at nuplayer Server for playback on nuplayer devices, only for configuration.
NewTek provides with their NDI-Tools a great software-suite by which you can easily generate and distribute signals for free.

… regarding UDP Multicast #

Be sure to enable Multicast Snooping/IGMP on your switches and that there’s a querier present. The easiest way to distribute a signal through multicast without dedicated hardware is with VLC media player. Another way to generate a multicast stream is to use dedicated hardware like PEC 1864 by LYNX Technik. To create a multicast RTP stream with VLC click File->Convert/Stream. Drop a video file and maybe change the video profile. For most use cases the “H.264 + MP3 (MP4)” profile is sufficient. Afterwards, click Stream and choose as type “RTP” and a multicast address and a destination port. It is recommended to choose an address from 239.0.0.0/8 range.

DEVICES window
VLC streaming window
DEVICES window
Example stream destination settings

This can also be achieved with the following command:

/Applications/VLC.app/Contents/MacOS/VLC path/to/inputfile.mp4 --sout="#rtp{mux=ts, dst=239.1.2.3, port=4444}"

Finally, you may add an rtp multicast stream to nuplayer Server.

External sources #

MediaMTX
https://github.com/bluenviron/mediamtx

FFmpeg
https://www.ffmpeg.org

Homebrew (for installing FFmpeg)
https://brew.sh

VLC media player
https://www.videolan.org

OBS
https://obsproject.com

OBS-RTSPServer plugin
https://github.com/iamscottxu/obs-rtspserver/

PEC 1864 by LYNX Technik AG
https://www.lynx-technik.com/products/yellobrik/video-conversion/pec-1864-3gbit-sdihdmi-h264-streamer-and-recorder/

NDI® Tools
https://ndi.video/tools/ndi-core-suite/