All Products
Search
Document Center

Intelligent Media Services:AddMediaConnectFlowInput

Last Updated:Mar 17, 2026

Adds an input to a MediaConnect Flow instance.

Operation description

  • If the specified flow instance ID does not exist, the API returns an error.

  • By default, a flow instance supports only one input. After you enable dual-stream disaster recovery, you can add a second input.

Input type descriptions

  • RTMP-PUSH: Creates an RTMP listener input. You can push your stream to the URL returned by the API using the RTMP protocol.

  • RTMP-PULL: Creates an RTMP origin fetch input. The flow instance pulls an RTMP live stream from your specified origin server.

  • SRT-Listener: Creates an SRT listener input. You can push your stream to the URL returned by the API using the SRT protocol.

  • SRT-Caller: Creates an SRT origin fetch input. The flow instance pulls an SRT live stream from your specified origin server.

  • Flow: Uses the output of another upstream flow instance as the input. You must specify both the upstream flow instance ID and the output name. The output of the upstream flow instance must be of the SRT-Listener or RTMP-PULL type. When flow instances cascade, they use a leased line by default. This supports cross-region distribution across multiple flow instances.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ice:AddMediaConnectFlowInput

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

FlowId

string

Yes

Flow instance ID

34900dc6-90ec-4968-af3c-fcd87f231a5f

InputProtocol

string

Yes

Input type

Valid values:

  • RTMP-PUSH :

    RTMP-PUSH

  • SRT-Caller :

    SRT-Caller

  • RTMP-PULL :

    RTMP-PULL

  • SRT-Listener :

    SRT-Listener

  • Flow :

    Flow

RTMP-PUSH

InputName

string

Yes

Input name

AliTestInput

MaxBitrate

integer

No

Maximum bitrate in bits per second (bps)

2000000

Cidrs

string

No

IP address whitelist in CIDR notation. Separate multiple CIDR blocks with commas.

19.168.1.1/32,18.168.1.1/16

InputFromUrl

string

No

Input URL. Required only when the input type is RTMP-PULL or SRT-Listener.

rtmp://pull.test.alivecdn.com/live/alitest

PairFlowId

string

No

Upstream Flow ID. Required only when the input type is Flow.

805fbdd0-575e-4146-b35d-ec7f63937b20

PairOutputName

string

No

Upstream Flow output name. Required only when the input type is Flow.

AliTestOutput

SrtLatency

integer

No

SRT latency in milliseconds. Required only when the input type is SRT-Listener or SRT-Caller.

1000

SrtPassphrase

string

No

SRT encryption key. Required only when the input type is SRT-Listener or SRT-Caller.

BETTERG08S01

SrtPbkeyLen

string

No

SRT encryption key length in bytes. Required only when the input type is SRT-Listener or SRT-Caller.

Valid values:

  • 0 :

    0

  • 16 :

    16

  • 24 :

    24

  • 32 :

    32

32

Response elements

Element

Type

Description

Example

object

Response body

Content

object

Response body

InputUrl

string

Input URL

rtmp://1.2.3.4:1935/live/AliTestInput_8666ec062190f00e263012666319a5be

InnerInputUrl

string

Description

string

API call description

OK

RetCode

integer

Error code. A value of 0 indicates success.

0

RequestId

string

Request ID

11357BE8-4C54-58EA-890A-5AB646EDE4B2

Examples

Success response

JSON format

{
  "Content": {
    "InputUrl": "rtmp://1.2.3.4:1935/live/AliTestInput_8666ec062190f00e263012666319a5be",
    "InnerInputUrl": ""
  },
  "Description": "OK",
  "RetCode": 0,
  "RequestId": "11357BE8-4C54-58EA-890A-5AB646EDE4B2"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.