All Products
Search
Document Center

ApsaraVideo Live:UpdateRtsLiveStreamTranscode

Last Updated:Nov 14, 2024

Updates a custom Real-Time Streaming (RTS) transcoding configuration.

Operation description

This operation supports the following types of custom transcoding templates: h264, h264-nbhd, h264-origin, and audio.

QPS limit

You can call this operation up to 10 times per second per account.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is 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.
OperationAccess levelResource typeCondition keyAssociated operation
live:UpdateRtsLiveStreamTranscodecreate
*Domain
acs:cdn:*:{#accountId}:domain/{#DomainName}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DomainstringYes

The main streaming domain, which cannot be modified.

example.com
AppstringYes

The name of the application to which the live stream belongs, which cannot be modified.

aliyun-test
TemplatestringYes

The ID of the custom transcoding template, which cannot be modified.

ld
TemplateTypestringYes

The type of the custom transcoding template, which cannot be modified.

h264
HeightintegerNo

The height of the output video. Unit: pixel.

The value must comply with the following rules:

  • Height ≥ 100: The height of the video is at least 100 pixels.
  • max(Height,Width) ≤ 2560: The larger of the width and height of the video cannot exceed 2,560 pixels.
  • min(Height,Width) ≤ 1440: The smaller of the width and height of the video cannot exceed 1,440 pixels. For example, a resolution of 1560 × 1560 pixels is invalid.
Note
  • This parameter is required when the TemplateType parameter is set to h264, h264-nbhd, or h264-origin.

  • If the TemplateType parameter is set to h264-origin, the highest resolution supported is 4K.

1280
WidthintegerNo

The width of the output video. Unit: pixel.

The value must comply with the following rules:

  • Width ≥ 100: The width of the video is at least 100 pixels.
  • max(Height,Width) ≤ 2560: The larger of the width and height of the video cannot exceed 2,560 pixels.
  • min(Height,Width) ≤ 1440: The smaller of the width and height of the video cannot exceed 1,440 pixels. For example, a resolution of 1560 × 1560 pixels is invalid.
Note
  • This parameter is required when the TemplateType parameter is set to h264, h264-nbhd, or h264-origin.

  • If the TemplateType parameter is set to h264-origin, the highest resolution supported is 4K.

720
FPSintegerNo

The frame rate of the output video. Unit: frames per second (FPS). Valid values: 1 to 60.

Note This parameter is required when the TemplateType parameter is set to h264, h264-nbhd, or h264-origin.
30
VideoBitrateintegerNo

The bitrate of the output video. Unit: Kbit/s. Valid values: 1 to 6000.

Note
  • This parameter is required when the TemplateType parameter is set to h264, h264-nbhd, or h264-origin.

  • The bitrate of the output video is as close to the value that you specify as possible, but not the same as the value, especially when the value is excessively large or small.

2000
AudioBitrateintegerNo

The bitrate of the output audio. Unit: Kbit/s. Valid values: 1 to 1000.

Note This parameter is required if you set the TemplateType parameter to audio.
128
GopstringNo

The group of pictures (GOP) of the output video. This parameter is used to specify the keyframe interval. Unit: seconds. Valid values: 1 to 3.

2
DeleteBframesbooleanNo

Specifies whether to remove B frames during transcoding. Valid values:

  • true: Remove B frames.
  • false (default): Retain B frames.
Note
  • This parameter is required when the TemplateType parameter is set to h264, h264-nbhd, or h264-origin.

  • If this parameter is not specified, the default value false is used.

false
OpusbooleanNo

Specifies whether to transcode streams to the Opus format to be compatible with native WebRTC. Valid values:

  • true: Transcode streams to the Opus format.
  • false: Do not transcode streams to the Opus format.
Note If this parameter is not specified, the default value false is used.
true
ProfileintegerNo

The video encoding profile. The profile defines a set of parameters that are used to encode a video. In most cases, a greater value indicates better image quality and higher resource consumption. Valid values:

  • 1: baseline. This value is suitable for mobile devices.
  • 2: main. This value is suitable for standard-definition devices.
  • 3: high. This value is suitable for high-definition devices.
2
AudioProfilestringNo

The audio codec profile. Valid values:

  • aac_low
  • aac_he
  • aac_he_v2
  • aac_ld
aac_low
AudioCodecstringNo

The audio encoder. Valid values:

  • aac
  • mp3
Note To use the Opus encoder, you need only to set the Opus parameter to true.
aac
AudioRateintegerNo

The audio sampling rate. Valid values: 22050, 32000, 44100, 48000, and 96000. 44100 is commonly used. Unit: Hz.

Note If the value of the AudioProfile parameter is aac_ld, the audio sampling rate cannot exceed 44,100.
44100
AudioChannelNumintegerNo

The number of sound channels. Valid values:

  • 1: mono
  • 2: stereo
2
LazystringNo

Specifies whether to enable triggered transcoding. Valid values:

  • yes: enables triggered transcoding.
  • no: disables triggered transcoding.
no

Response parameters

ParameterTypeDescriptionExample
object

The request ID.

RequestIdstring

The request ID.

16A96B9A-F203-4EC5-8E43-CB92E68F4CD8

Examples

Sample success responses

JSONformat

{
  "RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68F4CD8"
}

Error codes

HTTP status codeError codeError message
400InvalidParameters%s
400ConfigAlreadyExists%s
400TemplateLimit%s

For a list of error codes, visit the Service error codes.