logo
On this page

RTMP Push Stream to ZEGO Server


Function Introduction

In live streaming scenarios, hosts can push audio and video streams to ZEGO servers through RTMP push streaming tools to achieve low latency effects. Viewers can use ZEGO Express SDK to play streams.

RTMP push streaming tools refer to third-party tools that push streams through RTMP addresses, mainly including hardware push streaming devices, software OBS, etc.

Prerequisites

  • Contacted ZEGOCLOUD Technical Support to enable relevant permissions for RTMP tools to push streams to ZEGO servers.

  • Prepared RTMP push streaming tools, such as OBS.

Usage Steps

Get RTMP Push Address

Please contact ZEGOCLOUD Technical Support to enable the service, and obtain the RTMP push address through the RTMP Push Dispatch server interface.

Use RTMP Tool to Push Stream

The following section takes OBS as an example to introduce the push streaming operation of RTMP tools.

Set Push Address

  1. Open the OBS tool. In the "Controls" tab of the bottom toolbar, click "Settings" to enter the settings interface.
  1. Click "Stream" to enter the stream settings tab, and select the service type as "Custom Streaming Server".

  2. Fill in the obtained RTMP push address in the "Server" and "Stream Key" fields.

  • Server: Corresponds to the RTMP push address, namely rtmp://hosts/AppName/

    Please note that the RTMP push address URL is different from the push address URL in CDN Push Authentication and cannot be mixed. Please pay attention to distinguish when using.

  • Stream Key: Corresponds to the RTMP push stream name, namely "streamID".

  1. Click "OK" to save the above settings.

Set Push Source

  1. In the "Sources" tab of the bottom toolbar, click the "+" button.
  1. Select the input source as needed, such as "Display Capture".

Use OBS to Push Stream

  1. In the "Controls" tab of the bottom toolbar, click "Start Streaming" to push the audio and video stream to the set push address. When a green light appears at the bottom, it means the push is successful.
  1. To stop pushing, click "Stop Streaming" in the "Controls" tab.
Warning

After using the RTMP tool to push streams, users cannot receive notifications of adding or deleting audio and video streams through the onRoomStreamUpdate callback. They can obtain them through the following two ways:

  • After using the RTMP tool to push streams, the business server sends the third-party push "streamID" to other users in the room through business signaling, notifying other users in the room that a stream has been added or deleted.
  • You can use ZEGO server's Add Room Stream and Delete Room Stream interfaces to add or delete a stream information to a specified room, and send the "streamID" information to other users in the room. At this time, other users can receive notifications of adding or deleting audio and video streams through the onRoomStreamUpdate callback.

Use SDK to Play/Stop Playing Stream

Call the startPlayingStream interface and pass in the "streamID" of the RTMP push stream (namely the "Stream Key" set in section 3.2.1) to play the stream.

// Start playing stream, set remote play rendering view. The view mode uses the SDK's default mode, proportional scaling to fill the entire View
// The following playView is a View on the UI interface.
ZegoCanvas playCanvas = new ZegoCanvas(playView);
engine.startPlayingStream("streamID", playCanvas);

Call the stopPlayingStream interface and pass in the "streamID" of the RTMP push stream (namely the "Stream Key" set in section 3.2.1) to stop playing the audio and video stream pushed remotely.

// Stop playing stream
engine.stopPlayingStream("streamID");

FAQ

1. How does the business server know whether the RTMP push streaming tool has started or stopped pushing streams?

ZEGO provides publish_start start push and publish_stop stop push callback notifications. If needed, please contact ZEGOCLOUD Technical Support to configure.

2026-03-05

Previous

Multi-Stream Mixing

Next

OBS Streaming with WHIP Protocol

On this page

Back to top