Set up two flows in MediaConnect to distribute content from one region to another. This topic uses transferring a stream from Singapore to Germany as an example to demonstrate how to do this.
How it works
Suppose that your source stream originates from Singapore and your receivers are located in Germany. You set up two flows in Alibaba Cloud regions closest to the source (Flow A) and receivers (Flow B).
As shown in the following diagram, the stream ingest client uploads content to Flow A, which then sends it to Flow B through the Alibaba Cloud network. The receivers in Germany pull the stream from Flow B to play the content.
Procedure
Configure Flow A
Create a flow.
Log on to the Intelligent Media Services (IMS) console. In the left-side navigation pane, choose . Click Create Flow.

Example configuration:
Flow Name: FlowA
Region: Singapore
Click OK to create the flow. Then, you are redirected to the flow details page. Save the Flow ID displayed. It will be referenced when configuring Flow B.

Configure the source.
On the flow details page, click Add Source Stream and configure parameters in the Add Source panel.

Example configuration:
Source Name: FlowAInput
Protocol: RTMP-PUSH
Max Bitrate: 1000000 bps
IP Address Whitelist: Optional.
Specify IP addresses that are allowed to send content to the source. If the parameter is left empty, no access control is enforced.
Configure the output.
On the flow details page, click the Outputs tab, then click Add Output.

Example configuration:
Output Name: FlowAOutput
Protocol: RTMP-PULL
Click OK. Save the output name (FlowAOutput). It will be referenced when configuring Flow B.
Configure Flow B
Create another flow in the IMS console.

Example configuration:
Flow Name: FlowB
Region: Germany (Frankfurt)
Click OK to create the flow. Then, you are redirected to the flow details page.
Configure the source.
On the flow details page, click Add Source Stream and configure parameters in the Add Source panel.

Example configuration:
Source Name: FlowBInput
Protocol: Flow
Flow ID: Enter the ID of Flow A.
Output Name: Enter the output name of Flow A (FlowAOutput).
NoteIf you fail to add Flow B, check if the flow ID and output name of Flow A are correctly configured.
Configure the output.
On the flow details page, click the Outputs tab, then click Add Output.

Example configuration:
Output Name: FlowBOutput
Protocol: RTMP-PULL
IP Address Whitelist: Optional. Specify IP addresses that are allowed to pull content. If this configuration is left empty, no access control is enforced.
Enable Flows A and B
On the flow details page, click Start on the Status panel.

You must enable both flows. For details, see Flow status.
Ingest and pull the stream
Ingest the stream
After you configured the input for Flow A, the system generated a Source URL for stream ingest. Push a stream to this URL on the stream ingest client.

Pull the stream
After you configured the output for Flow B, the system generated an output URL. The viewers can pull the stream from this URL for playback.

Notes on protocols
MediaConnect supports the RTMP and SRT protocols. The protocols of source and destination flows must be compatible. This example uses RTMP.
Flow A input
In this example, the protocol of Flow A input is set to RTMP-PUSH. You can also set it to RTMP-PULL, which indicates that Flow A pulls a stream from the specified source URL. For more information, see Add a source to a flow.
Flow B output
In this example, the protocol of Flow B output is set to RTMP-PULL. You can also configure it as RTMP-PUSH. Then, Flow B will push the stream to the specified output URL. For more information, see Add an output to a flow.
Flow A output
As the protocol of Flow B input is set to Flow, the protocol of Flow A output must be RTMP-PULL.
The following table summarizes the supported protocol configurations for cross-region transmission between two flows:
Flow A | Flow B | ||
Input | Output | Input | Output |
RTMP-PUSH/RTMP-PULL | RTMP-PULL | Flow | RTMP-PUSH/RTMP-PULL |
RTMP-PUSH/RTMP-PULL | Flow | RTMP-PUSH | RTMP-PUSH/RTMP-PULL |
SRT-Listener/SRT-Caller | SRT-Listener | Flow | SRT-Listener/SRT-Caller |
SRT-Listener/SRT-Caller | Flow | SRT-Listener | SRT-Listener/SRT-Caller |