DEV Community

Cover image for Stream Any NDI Source to a Browser with WebRTC in 5 Steps
Malti Thakur for Ant Media

Posted on

Stream Any NDI Source to a Browser with WebRTC in 5 Steps

NDI is great inside a studio, but getting an NDI feed in front of viewers usually means an extra encoder converting it to RTMP or SRT first. That is one more component to configure and maintain.

Ant Media Server Enterprise can discover NDI sources on your network, ingest them directly, and serve them to browsers over WebRTC. Here is the whole flow:

NDI camera or production app → Ant Media Server → viewers (WebRTC, HLS or LL-HLS)

What you need

  • Ant Media Server Enterprise 3.1.0 or later (a 14-day free trial covers every step, including WebRTC playback)
  • An NDI sender on the same LAN: an Android NDI camera app, NDI Tools Test Patterns, OBS Studio with the DistroAV plugin, or an NDI-enabled camera or switcher ## The 5 steps

1. Enable mDNS discovery

Install and start Ant Media Server Enterprise, then on Ubuntu make sure avahi-daemon is running:

sudo apt update
sudo apt install -y avahi-daemon avahi-utils
sudo systemctl enable --now avahi-daemon
Enter fullscreen mode Exit fullscreen mode

Allow mDNS on UDP port 5353, and make sure your firewall also allows the NDI media connection between sender and server. Discovery traffic alone will not carry the stream.

2. Start an NDI source

Use whatever you have on the same network:

  • Android NDI camera app: join the same Wi-Fi and start broadcasting
  • NDI Tools: launch Test Patterns
  • OBS Studio: install the NDI Runtime and DistroAV, then enable Main Output under Tools > DistroAV NDI Settings and give it a clear name
  • PTZ camera or hardware switcher: enable NDI output in the device settings ### 3. Open your application

In the Ant Media Server web panel, open your app (for example LiveApp) and go to the Live Streams tab.

4. Add the NDI source as a live stream

Click New Live Stream, choose NDI Stream, and pick your source. Once the feed is received, the status shows Broadcasting.

5. Play it over WebRTC

Open the stream action menu and select Play With WebRTC. Your NDI feed is now playing in the browser, with no RTMP or SRT encoder in between.

Streaming NDI across a WAN

mDNS discovery is local, so a cloud-hosted server will not find a studio source automatically. You have three options:

  • NDI Discovery Server: discovery without multicast (the media path must still be reachable)
  • NDI Bridge: connects NDI environments across a WAN
  • VPN: gives connectivity, but do not assume it forwards mDNS

    Troubleshooting

  • Source missing in the dashboard: check the sender is running and mDNS can reach the server

  • Listed but not broadcasting: check NDI media connectivity

  • Broadcasting but WebRTC fails: check the browser-to-server connection and the server logs

    Next step: embed the player

Copy the embed code from the dashboard and paste it into your own page. The player loads from https://your-server:5443/LiveApp/play.html?id=your-stream-id. See the embedded player guide for SSL and token-protected playback.


Full walkthrough with screenshots: NDI to WebRTC: Stream Any NDI Source to a Browser in 5 Steps

NDI® is a registered trademark of Vizrt NDI AB.

Top comments (0)