StreamLive API Reference โ
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 โ
| Item | Value |
|---|---|
| Endpoint | POST https://mdl.tencentcloudapi.com |
| Action | See the API list below |
| Request signature | Use the Tencent Cloud API 3.0 signature of the official SDK / TCCLI |
Basic Information โ
| Item | Value |
|---|---|
| API service code | mdl |
| API version | 2020-03-26 |
| Authentication | Tencent Cloud API 3.0 / TC3-HMAC-SHA256 |
| Calling tool | Tencent 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 โ
| Action | Operation |
|---|---|
CreateStreamLiveInputSecurityGroup | Create |
DescribeStreamLiveInputSecurityGroups | Query |
CreateStreamLiveInput | Create |
DescribeStreamLiveInput | Query |
CreateStreamLiveChannel | Create |
DescribeStreamLiveChannel | Query |
StartStreamLiveChannel | Start |
StopStreamLiveChannel | Stop |
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 โ
| Symptom | What to check |
|---|---|
| CLI Action | Check the exact Action name and TCCLI version |
| Input signal โ | Sending address, AppName / StreamName, input security group |
| Template name | 1~20 characters, English letters / digits |
| Only one quality output | The connection between Outputs and each template, the actual master playlist |
| Channel modification | Check 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.
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.
| Operation | Action |
|---|---|
| Create | CreateStreamLiveInputSecurityGroup |
| List query | DescribeStreamLiveInputSecurityGroups |
| Detail query | DescribeStreamLiveInputSecurityGroup |
| Modify | ModifyStreamLiveInputSecurityGroup |
| Delete | DeleteStreamLiveInputSecurityGroup |
tccli mdl DescribeStreamLiveInputSecurityGroups --region ap-seoulCheck 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 โ
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.
tccli mdl DescribeStreamLiveInput --region ap-seoul --Id REPLACE_INPUT_IDUse 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.
tccli mdl CreateStreamLiveChannel --region ap-seoul --cli-input-json file://channel.json| Setting | Role |
|---|---|
AttachedInputs | The input to connect |
AVTemplates | Combined video / audio template |
AudioTemplates, VideoTemplates | Separate audio / video templates |
OutputGroups | Output method, per-quality outputs, destination |
In the combined example, one template is connected to each per-quality Output.
4. Query / Start โ
tccli mdl DescribeStreamLiveChannel --region ap-seoul --Id REPLACE_CHANNEL_ID
tccli mdl StartStreamLiveChannel --region ap-seoul --Id REPLACE_CHANNEL_IDAfter execution, check the channel status, input signal, output list, packager reception, and player playback.
5. Stopping and Modifying โ
tccli mdl StopStreamLiveChannel --region ap-seoul --Id REPLACE_CHANNEL_IDApply changes that require stopping the channel during a maintenance window or after preparing a separate path, while the channel is in the IDLE state.