AWS for M&E Blog
Using NDI for video switching and routing in AWS
Network Device Interface (NDI) is a royalty-free standard developed to facilitate near real-time and ultra-low latency video communication over internet protocol (IP) in a frame-accurate manner without compromising quality. This technology is a bidirectional standard that allows video systems to identify and communicate with one another over IP and to encode, transmit, and receive multiple streams of video and audio in near real time. The NDI encoding algorithm is resolution and frame-rate independent and supports multichannel, floating-point audio. NDI also includes tools to implement video and audio access and grouping, bidirectional metadata, tally, and remote connections. The system benefits media houses in building live production workflows by facilitating communication between production systems, like graphics, mixers, switching, cameras, and editing stations, all using IP-based networks.
Although NDI supports mDNS to give NDI receivers knowledge about existing NDI senders in a network, we focus in this blog post on the NDI Discovery method for significantly large NDI deployments where mDNS might not be practical. NDI Discovery Server is a thin application operating entirely in unicast mode, managing a centralized repository for the NDI sources in the network. It is recommended to have NDI devices perform discovery in cloud platforms.
NDI Discovery Server works for both NDI receivers and NDI source devices by configuring the Discovery Server address into NDI Access Manager Application. The NDI Discovery Server makes a persistent connection to all configured devices and constantly informs the receivers on NDI source availability. For example, if an NDI source stops, the connection to NDI Discovery Server will end, and Discovery Server intimates all the NDI receivers about the unavailability of that NDI source. Similarly, when the new NDI source establishes a connection with NDI Discovery Server, the server intimates the new NDI source’s availability to all the NDI receivers.
In this post, we take you through the steps to configure highly resilient NDI traffic within a virtual private cloud (VPC) using NDI Discovery Server in the Amazon Web Services (AWS) Cloud.
Schematic view
Step 1. Create VPC.
Create a simple VPC using the AWS CloudFormation VPC template. AWS CloudFormation lets you model, provision, and manage AWS and third-party resources by treating infrastructure as code. The template creates VPCs with two public subnets and two private subnets along with VPC components, like internet gateway and NAT gateway. However, this blog limits the NDI traffic activation to two public subnets within the VPC.
Step 2. Install NDI Discovery Server.
The NDI Discovery Server application is extremely thin and nonresource intensive; hence, we recommend using general-purpose Amazon Elastic Compute Cloud (Amazon EC2) instance type like Amazon EC2 T3 Instances, which are an Amazon EC2 low-cost, burstable, general-purpose instance type.
- For NDI Discovery Server, launch two Linux Server Amazon EC2 T3 Instances within a VPC that each map to different public subnets.
- [Optional] Specify below NDI Discovery Server installation commands against “user data” while launching the instance. For more details on user data at launch, please refer to this document. The command below downloads, installs, and runs the NDI Discovery Server.
- Configure the security group to use inbound rules, allowing all traffic for VPC classless interdomain routing.
- Log in to both instances using valid credentials.
- Initiate the following command on the shell (skip if step “b” is followed):
- Download NDI Discovery Server.
-
- Extract NDI Discovery Server install.
-
- Accept NDI license agreement and install.
-
- Run NDI Discovery Server in the background or foreground, depending on your need.
Step 3. Create two Windows instances on Amazon EC2, a web service that provides secure, resizable compute capacity in the cloud. These instances act like both NDI sender and receiver to demonstrate the video discovery and switching.
For this step, use Amazon EC2 G3 Instances, which are Amazon EC2 GPU graphics instances, or Amazon EC2 G4 Instances, which are cost-effective, versatile GPU instances (use Amazon EC2 G4dn Instances).
- Launch two Windows Server instances in a VPC that each map to different public subnets—use Amazon EC2 G3 Instances or Amazon EC2 G4dn Instances.
- Configure the security group to use inbound rules, allowing all traffic for VPC classless interdomain routing.
- Log in to both the instances using valid credentials.
Step 4. Install necessary drivers and software on the Amazon EC2 instances.
- Install NVIDIA drivers by following these instructions.
- Install OBS Studio on both the instances.
- Install OBS-NDI plugin on both the instances.
- Install NDI Tools on both the instances.
Step 5. [Manual] Register two Windows instances with NDI Discovery Server.
- Log in to both the instances using valid credentials.
- Open the NDI Access Manager application under NDI Tools in both Amazon EC2 instances using the Start button.
- Click the Advanced tab and select Discovery Servers under Network Mapping. Configure IP Addresses with private IP address of both NDI Discovery Server that was created in step 2, separated by a comma.
Step 6. [Automated] Register two Windows instances with NDI Discovery Server.
Instead of manual registration of each NDI-facilitated instances for NDI Discovery Server, we can automate using a function of AWS Lambda, a serverless, event-driven compute service that lets you run code for virtually any type of application or backend service.
- Open the AWS Lambda console.
- In the navigation pane, select Functions.
- Select the Create Function button.
- In Basic Information, enter Function Name as “discovery-server-provision”.
- Select Ruby 2.7 as a runtime.
- Select the Create Function button.
- In the Code tab, double-click “lambda_function.rb”.
- Copy the following code snippet and replace the existing code displayed in the editor section.
- Select the Deploy button.
Below is the code snippet for “discovery-server-provision” AWS Lambda (Ruby source).
Step 8. Test the NDI traffic.
Configuring NDI on the first instance.
- Log in to one Amazon EC2 instance using valid credentials. We named it as “NDI–Host1”.
- Activate NDI output in OBS Studio.
- Open the OBS application.
- Select Tools, and choose “NDI Output settings.”
- Select Main Output. For the main output name, enter the name of your choice. We used “OBS-Output1”.
Configuring NDI on the second instance.
- Log in to the second Amazon EC2 instance using valid credentials. We named it as “NDI–Host2”.
- Activate the NDI output in OBS Studio.
- Open the OBS application.
- Select Tools, and choose “NDI Output settings.”
- Select Main Output. For the main output name, enter the name of your choice. We used “OBS-Output2”.
Check Video Sharing between instances.
- Open the NDI Studio Monitor application under NDI Tools in both Amazon EC2 instances using the Start button.
- The NDI Studio Monitor discovers both NDI outputs generated by both instances.
- Select NDI–HOST2 > OBS-Output2 in NDI-HOST1 instance.
- Select NDI-HOST1 > OBS-Output1 in NDI-HOST2 instance.
- Video is shared between two instances using NDI.
Conclusion
In this post, we walked through how to use NDI Discovery Server to configure NDI traffic within a VPC that facilitates communication between NDI-activated video processing software within IP network–based live video production.
Remember to stop the Amazon EC2 Instance when you are not using it. This stops the instance from incurring costs when not in use. To delete the instance permanently, close out the instance.
NDI is a registered trademark of Vizrt Group.