Adds a subtitle rule.
Usage notes
- After you call the AddLiveAISubtitle operation to add a subtitle template, you can call this operation to create a subtitle rule for the template.
- You must add "_Subtitle template name" after the stream name in the streaming URL to play the subtitle stream.
- RTMP: rtmp://example.aliyundoc.com/app/stream_{Subtitle template name}?auth_key={Access token}
- FLV: http://example.aliyundoc.com/app/stream_{Subtitle template name}.flv?auth_key={Access token}
- M3U8: http://example.aliyundoc.com/app/stream_{Subtitle template name}.m3u8?auth_key={Access token}
QPS limit
You can call this operation up to 60 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see QPS limits.
Debugging
Request parameters
Parameter |
Type |
Required |
Example |
Description |
Action | String | Yes | AddLiveAIProduceRules | The operation that you want to perform. Set the value to AddLiveAIProduceRules. |
Domain | String | Yes | demo.aliyundoc.com | The main streaming domain. |
App | String | Yes | AppName | The name of the application to which the live stream belongs. |
SubtitleName | String | Yes | sub01 | The name of the subtitle template. |
IsLazy | Boolean | No | true | Specifies whether to trigger the subtitle rule when stream pulling starts. Valid values:
|
LiveTemplate | String | Yes | lp_ld | The specification of the output subtitles. Valid values:
|
Description | String | No | live AI subtitle template | The description of the subtitle rule. The description can be up to 128 characters in length and can contain letters, digits, and special characters. |
Response parameters
Parameter |
Type |
Example |
Description |
RequestId | String | 5c6a2a0df228-4a64-af62-20e91b96**** | The request ID. |
RulesId | String | 445409ec-7eaa-461d-8f29-4bec2eb9**** | The ID of the subtitle rule. |
Examples
Sample requests
http(s)://live.aliyuncs.com/?Action=AddLiveAIProduceRules
&Domain=demo.aliyundoc.com
&App=AppName
&SubtitleName=sub01
&IsLazy=true
&LiveTemplate=lp_ld
&IsOrigin=true
&Description=live AI subtitle template
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<AddLiveAIProduceRulesResponse>
<RequestId>5c6a2a0df228-4a64-af62-20e91b96****</RequestId>
<RulesId>445409ec-7eaa-461d-8f29-4bec2eb9****</RulesId>
</AddLiveAIProduceRulesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "5c6a2a0df228-4a64-af62-20e91b96****",
"RulesId" : "445409ec-7eaa-461d-8f29-4bec2eb9****"
}
Error codes
HTTP status code |
Error code |
Error message |
Description |
400 | MissingParameter | %s. | One or more required parameters are missing. |
400 | InvalidParameter | %s. | One or more parameters are invalid. |
For a list of error codes, see Service error codes.