Media Gateway overview

Updated

Overview and capabilities of Agora's Media Gateway service, including supported protocols, transcoding features, and common use cases.

Agora's Media Gateway service enables publishing RTMP, SRT, and WHIP streams into Agora's real-time voice and video channels. By performing advanced transcoding at the edge, it reduces latency compared to traditional RTMP streaming and unlocks new possibilities for publishing and controlling real-time media streams.

Compatible with popular streaming tools, Media Gateway lets broadcasters maintain their existing setups while leveraging Agora SDRTN(R) for seamless and reliable delivery.

Applicable use cases

Use caseDescription
Commentary from influencers and celebritiesInject high-definition video streams into interactive channels. Multiple hosts can watch and interact in real time from different places.
Low-latency distributionDistribute content to viewers faster and more reliably than with a CDN.
Recording and live broadcastingA teacher records content in advance and injects it into a live classroom. Students and teaching assistants can watch the content and interact in real time.
24-hour chat roomBackground music is played continuously and is not interrupted when switching hosts.

Start building

Product features

High reliability

Enhance service reliability with a globally distributed cluster deployment, ensuring high-quality and seamless user experience in every region.

Low latency

Experience seamless, real-time communication as the source stream directly enters the channel at the gateway, minimizing latency between the host and the audience.

Transcoding support

Employ advanced transcoding capabilities on media streams for bandwidth optimization, enhanced delivery speed, cross-device compatibility, and wider distribution.

Stable and easy to use

Simple and easy to use APIs help you integrate the feature quickly.

Safety compliance

Safe and secure real-time transmission of audio and video data without caching or collecting users' personal information.

Multi-format, multi-protocol media streaming support

Works with several audio and video codecs, streaming protocols, and media formats.

Feature details

FeatureDescription
Media inputSupports generating a streaming key through a RESTful API or a local encryption algorithm, then pushing the source stream directly to Agora's gateway service. After a successful push, the media stream is automatically played in the channel for remote users. Streaming keys can be scoped to a single region or created as global keys that work across all Media Gateway regions.
Multiple media streaming formats and protocolsSupports H.264, H.265, and AV1 video codecs, AAC, OPUS, and G.711 (A-law and u-law) audio codecs, RTMP, SRT, and WHIP push protocols, and FLV and MPEG-TS media formats.
Custom transcoding parametersSupports enabling transcoding for media streams input into the channel. If you enable transcoding, you can set parameters such as resolution, frame rate, bitrate, and whether to enable large and small streams. You can also transcode conditionally, so a stream is transcoded only when the source doesn't already meet your target specification.
Custom domains and TLS certificatesSupports managing your own RTMPS streaming domain and TLS certificate through the REST API, either by requesting an Agora-issued certificate or importing your own.
Dual-stream high availabilitySupports binding two streaming keys to the same channel and user ID and pushing to a primary and backup domain simultaneously. Media Gateway can automatically fail over to the backup stream if the primary stream drops or degrades in quality.
Restricted access areaWhen activating Media Gateway, you specify the access area to ensure the transmission quality of the media stream.
Server event notification callbackAgora provides message notification services. After activating Media Gateway, you receive event notifications.

Related APIs and implementation entry points

Use the following references when you implement the core Media Gateway capabilities described in Feature details:

The main API groups map to product features as follows:

Feature areaAPIs or guides
Media input and streaming key managementUse the streaming key APIs in the REST API overview to create, query, and delete streaming keys. For a local streaming key generation example or to create a global streaming key, see the Quickstart.
Online stream controlUse the online stream APIs in the REST API overview to query active streams, inspect stream details, force disconnect a stream, or mute and unmute audio or video.
Custom transcoding parametersUse template APIs in the REST API overview to create, update, delete, or set default transcoding templates for ingress streams. To transcode only when needed, see Adaptive transcoding.
Custom domains and TLS certificatesManage your own RTMPS domain and certificate by following RTMP and RTMPS streaming.
Dual-stream high availabilitySet up automatic failover between a primary and backup stream by following Dual-stream.
Server event notification callbackConfigure notifications by following Receive webhook notifications, then use the event type reference to interpret callback payloads.