Skip to content

StreamLive API Reference โ€‹

Updated

The API service code of StreamLive is mdl, and the API version is 2020-03-26. Create resources in the order security group โ†’ input โ†’ channel, then after starting the channel, check the actual reception and playback.

Calling Specifications โ€‹

ItemValue
EndpointPOST https://mdl.tencentcloudapi.com
ActionSee the API list below
Request signatureUse the Tencent Cloud API 3.0 signature of the official SDK / TCCLI

Basic Information โ€‹

ItemValue
API service codemdl
API version2020-03-26
AuthenticationTencent Cloud API 3.0 / TC3-HMAC-SHA256
Calling toolTencent Cloud SDK / TCCLI

Preparations Before Execution โ€‹

Configure TCCLI authentication and permissions. The example region is ap-seoul, and replace the REPLACE_ identifier and the documentation IP 203.0.113.10/32 with actual values. Before running a create command again, check the existing creation results.

API List and Request Parameters โ€‹

ActionOperation
CreateStreamLiveInputSecurityGroupCreate
DescribeStreamLiveInputSecurityGroupsQuery
CreateStreamLiveInputCreate
DescribeStreamLiveInputQuery
CreateStreamLiveChannelCreate
DescribeStreamLiveChannelQuery
StartStreamLiveChannelStart
StopStreamLiveChannelStop

Response and Execution Flow โ€‹

Keep the resource ID returned in the create response and check the status with the query API. Distinguish between the success of the create request and the success of the actual input reception and output transmission. Run the next step after confirming the state of the relevant resource.

Errors and Call Limits โ€‹

Connection Verification โ€‹

SymptomWhat to check
CLI ActionCheck the exact Action name and TCCLI version
Input signal โ€”Sending address, AppName / StreamName, input security group
Template name1~20 characters, English letters / digits
Only one quality outputThe connection between Outputs and each template, the actual master playlist
Channel modificationCheck the task target and the required channel state

When making a request inquiry, provide the Action, region, response code, RequestId, and time of occurrence. Clean up the transport / storage / distribution resources after testing.

Request Examples โ€‹

1. Input Security Group โ€‹

The API for creating a security group is CreateStreamLiveInputSecurityGroup.

bash
tccli mdl CreateStreamLiveInputSecurityGroup --region ap-seoul \
  --Name demo_source_allowlist --Whitelist '["203.0.113.10/32"]'

Allow the actual public IP of the sending side. If StreamLink is at the front, you must check the sending-side address that StreamLink connects from, not the IP of viewers or of the task PC.

OperationAction
CreateCreateStreamLiveInputSecurityGroup
List queryDescribeStreamLiveInputSecurityGroups
Detail queryDescribeStreamLiveInputSecurityGroup
ModifyModifyStreamLiveInputSecurityGroup
DeleteDeleteStreamLiveInputSecurityGroup
bash
tccli mdl DescribeStreamLiveInputSecurityGroups --region ap-seoul

Check the security group ID to use in the create or query response. This input security group is a StreamLive resource that is distinct from general CVM/VPC security groups.

2. Creating an RTMP Input โ€‹

bash
tccli mdl CreateStreamLiveInput --region ap-seoul \
  --Name demo_input --Type RTMP_PUSH \
  --SecurityGroupIds '["REPLACE_SECURITY_GROUP_ID"]' \
  --InputSettings '[{"AppName":"demo","StreamName":"source"}]'

The configuration above is an RTMP_PUSH example. For the Pull type, check the source URL; for the SRT type, check the corresponding SRT settings. One input can be connected to one security group.

bash
tccli mdl DescribeStreamLiveInput --region ap-seoul --Id REPLACE_INPUT_ID

Use the sending address displayed in the query response or in the console.

3. Creating a Channel โ€‹

Save the JSON of channel configuration as channel.json, and replace the input ID and the StreamPackage channel ID.

bash
tccli mdl CreateStreamLiveChannel --region ap-seoul --cli-input-json file://channel.json
SettingRole
AttachedInputsThe input to connect
AVTemplatesCombined video / audio template
AudioTemplates, VideoTemplatesSeparate audio / video templates
OutputGroupsOutput method, per-quality outputs, destination

In the combined example, one template is connected to each per-quality Output.

4. Query / Start โ€‹

bash
tccli mdl DescribeStreamLiveChannel --region ap-seoul --Id REPLACE_CHANNEL_ID
tccli mdl StartStreamLiveChannel --region ap-seoul --Id REPLACE_CHANNEL_ID

After execution, check the channel status, input signal, output list, packager reception, and player playback.

5. Stopping and Modifying โ€‹

bash
tccli mdl StopStreamLiveChannel --region ap-seoul --Id REPLACE_CHANNEL_ID

Apply changes that require stopping the channel during a maintenance window or after preparing a separate path, while the channel is in the IDLE state.

Reference Documents โ€‹

Built with VitePress ยท Deployed on Tencent EdgeOne Pages