All Products
Search
Document Center

Intelligent Media Services:AddMediaConnectFlowInput

Last Updated:Dec 08, 2025

Creates a source for a MediaConnect flow.

Operation description

  • When the specified flow ID is not available, an error code is returned.
  • A flow can have only one source.

Source type

  • RTMP-PUSH: An input that you can push to the returned URL over the RTMP protocol.
  • RTMP-PULL: An input that the MediaConnect flow pulls from the specified server over the RTMP protocol.
  • SRT-Listener: An input that you can push to the returned URL over the SRT protocol.
  • SRT-Caller: An input that the MediaConnect flow pulls from the specified server over the SRT protocol.
  • Flow: An input that uses the output of another upstream flow. You must specify an upstream flow and its output. The output type of the upstream flow must be SRT-Listener or RTMP-PULL. By default, a dedicated line is used when flows are cascaded. This allows for cross-region distribution among multiple flows.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ice:AddMediaConnectFlowInputcreate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
FlowIdstringYes

The flow ID.

34900dc6-90ec-4968-af3c-fcd87f231a5f
InputProtocolstringYes

The source type.

Valid values:

  • RTMP-PUSH
  • SRT-Caller
  • RTMP-PULL
  • SRT-Listener
  • Flow
RTMP-PUSH
InputNamestringYes

The source name.

AliTestInput
MaxBitrateintegerNo

The maximum bitrate. Unit: bit/s.

2000000
CidrsstringNo

The IP address whitelist in CIDR format. Separate multiple CIDR blocks with commas (,).

19.168.1.1/32,18.168.1.1/16
InputFromUrlstringNo

The source URL. This parameter is required when the source type is RTMP-PULL or SRT-Listener.

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

The ID of the source flow. This parameter is required when the source type is Flow.

805fbdd0-575e-4146-b35d-ec7f63937b20
PairOutputNamestringNo

The output of the source flow. This parameter is required when the source type is Flow.

AliTestOutput
SrtLatencyintegerNo

The latency for the SRT stream. This parameter is required the source type is SRT-Listener or SRT-Caller.

1000
SrtPassphrasestringNo

The SRT key. This parameter is required when the source type is SRT-Listener or SRT-Caller.

BETTERG08S01
SrtPbkeyLenstringNo

The encryption key length. This parameter is required when the source type is SRT-Listener or SRT-Caller.

Valid values:

  • 0
  • 16
  • 24
  • 32
32

Response parameters

ParameterTypeDescriptionExample
object

The response content.

Contentobject

The response body.

InputUrlstring

The source URL.

rtmp://1.2.3.4:1935/live/AliTestInput_8666ec062190f00e263012666319a5be
Descriptionstring

The call description.

OK
RetCodeinteger

The returned error code. A value of 0 indicates the call is successful.

0
RequestIdstring

The ID of the request.

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

Examples

Sample success responses

JSONformat

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

Error codes

For a list of error codes, visit the Service error codes.