All Products
Search
Document Center

:AddLiveAIProduceRules

最終更新日:Aug 12, 2024

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}
Important The live subtitles feature is in invitational preview. You can add up to 300 subtitle templates.

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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:

  • true: generates live subtitles when stream pulling starts and stops generating live subtitles when no stream is pulled for 5 minutes. When stream pulling restarts, live subtitles are generated again.
  • false: generates live subtitles when stream ingest starts, regardless of whether stream pulling starts.
LiveTemplate String Yes lp_ld

The specification of the output subtitles. Valid values:

  • lp_ld: landscape low definition 360p (640×360)
  • lp_ld_v: portrait low definition 360p (360×640)
  • lp_sd: landscape standard definition 480p (854×480)
  • lp_sd_v: portrait standard definition 480p (480×854)
  • lp_hd: landscape high definition 720p (1280×720)
  • lp_hd_v: portrait high definition 720p (720×1280)
  • lp_ud: landscape ultra-high definition 1080p (1920×1080)
  • lp_ud_v: portrait ultra-high definition 1080p (1080×1920)
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.