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
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 Resourcesis 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.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| ice:AddMediaConnectFlowInput | create | *All Resources * |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| FlowId | string | Yes | The flow ID. | 34900dc6-90ec-4968-af3c-fcd87f231a5f |
| InputProtocol | string | Yes | The source type. Valid values:
| RTMP-PUSH |
| InputName | string | Yes | The source name. | AliTestInput |
| MaxBitrate | integer | No | The maximum bitrate. Unit: bit/s. | 2000000 |
| Cidrs | string | No | The IP address whitelist in CIDR format. Separate multiple CIDR blocks with commas (,). | 19.168.1.1/32,18.168.1.1/16 |
| InputFromUrl | string | No | The source URL. This parameter is required when the source type is RTMP-PULL or SRT-Listener. | rtmp://pull.test.alivecdn.com/live/alitest |
| PairFlowId | string | No | The ID of the source flow. This parameter is required when the source type is Flow. | 805fbdd0-575e-4146-b35d-ec7f63937b20 |
| PairOutputName | string | No | The output of the source flow. This parameter is required when the source type is Flow. | AliTestOutput |
| SrtLatency | integer | No | The latency for the SRT stream. This parameter is required the source type is SRT-Listener or SRT-Caller. | 1000 |
| SrtPassphrase | string | No | The SRT key. This parameter is required when the source type is SRT-Listener or SRT-Caller. | BETTERG08S01 |
| SrtPbkeyLen | string | No | The encryption key length. This parameter is required when the source type is SRT-Listener or SRT-Caller. Valid values:
| 32 |
Response parameters
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.
