This is a Helm chart package to manage Media Gateway deployment on your Kubernetes cluster.
Media Gateway Helm Chart
Basic Introduction
This is a Helm chart package to manage Media Gateway deployment on your Kubernetes cluster.
Prerequisites
-
Rivermax license
- Request a developer license at Rivermax Download
- Store the license file in a Secret:
where:
kubectl create secret generic rivermax-license --from-file=rivermax.lic -n <your-namespace><your-namespace>is the Kubernetes namespace in which you are going to deploy applications, often justdefaultwhen you're getting started
- The Helm chart creates a volume from this Secret which is mounted into the container at
/opt/mellanox/rivermax
-
Image pull secret
- Create a secret to pull images from the NGC registry in the same namespace as the pod that uses it:
where:
kubectl create secret docker-registry <secret-name> --docker-server=nvcr.io '--docker-username=$oauthtoken' --docker-password=<API-KEY> --docker-email=<your-email> -n <your-namespace><secret-name>is a short name likealice-ngc-secretto be used on your local system when deploying applications<API-KEY>is your NGC API Key<your-email>is the e-mail address you used to sign up for NGC<your-namespace>is the Kubernetes namespace in which you are going to deploy applications, often justdefaultwhen you're getting started
- Create a secret to pull images from the NGC registry in the same namespace as the pod that uses it:
Installation
Using NGC CLI and NGC Web UI
Please see the NGC Helm Charts documentation for general guidance.
Using Helm Dashboard
This Helm chart can be installed on your Kubernetes cluster using the Helm Dashboard UI once the Helm Dashboard Helm Chart is installed.
Using Helm
-
Login to the NGC registry
helm registry login nvcr.io -
Add repo on your local system
helm repo add <your-repo-name> https://helm.ngc.nvidia.com/nvidia/holoscan-for-media/ '--username=$oauthtoken' --password=<API-KEY>where:
<your-repo-name>is a short name likeholoscan-for-mediato be used on your local system to indicate the chart repository on NGC specified by the URL<API-KEY>is your NGC API Key
-
Update the repo or fetch particular chart
helm repo updateor
helm pull <your-repo-name>/nvds-nmos-binwhere:
<your-repo-name>is the short name you used in thehelm repo addcommand above
-
Now you can see all the charts available
helm search repo -
You are ready to install Media Gateway using its Helm chart
Install using below command if the image pull secret was created beforehand as mentioned in prerequisites
helm install --set imagePullSecrets[0].name=<secret-name>,<...more key=value overrides...> <release-name> <your-repo-name>/nvds-nmos-binelse
helm install --set imageCredentials.password=<API-KEY>,<...more key=value overrides...> <release-name> <your-repo-name>/nvds-nmos-binwhere:
<secret-name>is the short name you used in thekubectl create secretcommand above<API-KEY>is your NGC API Key<...more key=value overrides...>are shown in the Helm chart'svalues.yamlfile<release-name>is a short name, likealice-nvds-nmos-bin-1, which should be unique on your local system, to indicate this particular installation of this application<your-repo-name>is the short name you used in thehelm repo addcommand above
-
After installation you can check the status
kubectl get all -o wide -
Once each pod is running its pipeline is started
If the pipeline includes
nvdsnmosbin, an NMOS device is created.Install the NMOS Registry and NMOS Controller to interact with NMOS devices.
-
Other commands to manage the installed application
helm status <release-name> helm get all <release-name> helm uninstall <release-name>where:
<release-name>is the short name you used in thehelm installcommand above
Defining Pipelines in Helm Charts
Media Gateway is built on DeepStream. It provides NMOS registration and control of ST 2110 sinks and sources in a flexible GStreamer pipeline passed to the container.
Sample pipeline for a videotestsrc with corresponding SDP file for the sink, all defined in values.yaml
-
GST_DEBUGcan be used to set the log level for GStreamer and elements/plugins fornvdsnmosbin -
descriptioncan be either:-
A custom pipeline that is appended to
gst-launch-1.0. Apart from the pipeline we can define some additional properties ofnvdsudpsinkand/ornvdsudpsrcin the manner shown below.description: videotestsrc pattern=smpte100 is-live=true ! video/x-raw,width={{ .Values.video.width }},height={{ .Values.video.height }},format=UYVP,framerate={{ .Values.video.framerate }}/1 ! nvdsnmosbin dump-graphviz=true name=sender hostname="simple-video.local" sink_0::nvdsudpsink-desc="nvdsudpsink payload-size=1220 packets-per-line=4 internal-thread-core=0 render-thread-core=1 ptp-src=''" sink_0::sdp="file:///sdps/video" sink_0::session-name="NvDsNmosBin testpattern sender"The
rtp-capsallow simple control over the SDP media parameters. Alternatively, SDP files can be specified directly as above. The SDP files used in the pipeline are defined as below.sdps: video: | v=0 o=- 1443716955 1443716955 IN IP4 0.0.0.0 s={{ .Values.video.height }}p{{ .Values.video.framerate }} video sender t=0 0 m=video 50004 RTP/AVP 96 c=IN IP4 233.252.0.1/64 a=source-filter: incl IN IP4 233.252.0.1 0.0.0.0 a=rtpmap:96 raw/90000 a=fmtp:96 sampling=YCbCr-4:2:2; width={{ .Values.video.width }}; height={{ .Values.video.height }}; exactframerate={{ .Values.video.framerate }}; depth=10; TCS=SDR; colorimetry=BT709; PM=2110GPM; SSN=ST2110-20:2017; TP=2110TPN; a=ts-refclk:ptp=IEEE1588-2008:traceable a=mediaclk:direct=0 -
One of the following predefined pipeline options:
1080p60-sender: Launches a pipeline for sending 1080p60 video1080p60-flipper: Launches a pipeline for both sending and receiving 1080p60 video1080p60-receiver: Launches a pipeline for receiving 1080p60 videomulti1080p60-sender: Launches a pipeline for sending multiple 1080p60 video streams2ch-48k-sender: Launches a pipeline for sending 2 channel sine wave audio at 48kHz (1ms ptime)2ch-48k-receiver: Launches a pipeline for receiving 2 channel audio at 48kHz (1ms ptime)
These predefined pipelines can be found in the
/workspace/example-gst-launch-commandsdirectory.Example usage in
values.yaml:description: 1080p60-senderNote: some of these pipelines depend on the SDP files created by the Helm deployment, and may only work with the audio/video property values in the default YAML.
-
High Speed Network Configuration
Media Gateway supports configuring high-speed network attachments for ST 2110 media transport. The highSpeedNetwork configuration supports both single and multiple network attachments.
Single Network Attachment (Default)
For a single high-speed network attachment, use the dictionary format:
pipelines:
pipeline1:
name: testpattern-sender
highSpeedNetwork:
name: "media-a-tx-net"
Multiple Network Attachments
For multiple high-speed network attachments, use the list format:
pipelines:
pipeline1:
name: testpattern-sender
highSpeedNetwork:
- name: "media-a-tx-net"
- name: "media-b-tx-net-static"
ip: "198.51.100.3/24"
For networks with static IP address management, the ip property is required as well as the network name.
Security Considerations
The main container used by this Helm chart requires the following capabilities to run properly:
| Capability | Purpose | Related Function |
|---|---|---|
| IPC_LOCK | To enable locking memory, to allocate hugepages with mmap | Rivermax |
| NET_RAW | To use RAW sockets | Rivermax |
| SYS_CHROOT (image version < 0.7.0) | To start avahi-daemon, for name resolution and service discovery | NMOS |
| SYS_NICE | To set process and thread affinity and priority | Rivermax |
| DAC_READ_SEARCH (image version >= 0.7.0) | To read the /sys file system | Rivermax |