Adds a custom transcoding configuration.
Operation description
This operation supports the following types of custom transcoding templates:
-
h264: a custom H.264 standard template.
-
h264-nbhd: a custom H.264 Narrowband HD™ template.
-
h265: a custom H.265 standard template.
-
h265-nbhd: a custom H.265 Narrowband HD template.
-
audio: an audio-only template.
QPS limit
This operation has a queries per second (QPS) limit of 6,000 calls per minute for each user. If you exceed the limit, API calls are throttled, which can affect your business. For more information, see QPS limit.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
live:AddCustomLiveStreamTranscode |
create |
*Domain
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The region ID. |
cn-shanghai |
| Domain |
string |
Yes |
The streaming domain. |
example.com |
| App |
string |
Yes |
The AppName of the live stream. |
liveApp**** |
| KmsKeyID |
string |
No |
The ID of the customer master key (CMK) in Key Management Service (KMS). |
afce5722-81d2-43c3-9930-7601da11**** |
| KmsUID |
string |
No |
The ID of the KMS account. |
25346073170691**** |
| KmsKeyExpireInterval |
string |
No |
The key rotation period. Unit: seconds. Valid values: 60 to 3600. |
3600 |
| Template |
string |
Yes |
The custom name of the transcoding template. Note The name can contain digits, letters, and hyphens (-). It must start with a digit or a letter. It cannot be the same as the name of a standard transcoding template. |
LiveCusTranscode**** |
| TemplateType |
string |
Yes |
The type of the custom transcoding template. Valid values:
Note For video types, Height, Width, FPS, and VideoBitrate are required. |
h264 |
| Height |
integer |
No |
Output video height in pixels. Requirements:
Note For h265-nbhd, it cannot exceed 720. |
720 |
| Width |
integer |
No |
Output video width in pixels. Requirements:
Note For h265-nbhd, it cannot exceed 1280. |
576 |
| FPS |
integer |
No |
The frame rate of the output video. Unit: frames per second (FPS). Valid values: 1 to 60. |
30 |
| VideoBitrate |
integer |
No |
The output video bitrate. Unit: kbps. Valid values: 1 to 6000. Note The system tries to transcode the video at the specified bitrate. However, the actual bitrate may not be the same as the specified value, especially when the specified value is too high or too low. |
720 |
| AudioBitrate |
integer |
No |
The output audio bitrate. Unit: kbps. Valid values: 1 to 1000. |
512 |
| Gop |
string |
No |
The Group of Pictures (GOP) size. The unit can be frame or second. Valid values:
|
1 |
| Profile |
integer |
No |
The video codec profile. A larger value indicates better video quality and higher resource consumption for encoding and decoding. Valid values:
|
2 |
| AudioProfile |
string |
No |
The audio profile. Valid values:
|
aac_low |
| AudioCodec |
string |
No |
The audio codec. Valid values:
|
AAC |
| AudioRate |
integer |
No |
The audio sample rate. Valid values: 22050 to 96000. Important If you set AudioProfile to aac_ld, the sample rate cannot exceed 44100. |
96000 |
| AudioChannelNum |
integer |
No |
The number of audio channels. Valid values:
|
2 |
| Lazy |
string |
No |
Specifies whether to enable on-demand transcoding. Valid values:
|
yes |
| EncryptParameters |
string |
No |
The encryption settings, formatted as a JSON string.
Note If set, its internal fields cannot be empty. |
{"EncryptType": "aliyun", "KmsKeyID":"afce5722-81d2-43c3-9930-7601da11****","KmsKeyExpireInterval":"3600"} |
| ResWithSource |
string |
No |
The adaptive resolution settings. If specified, it overrides the Height and Width parameters. Fieds:
|
{"Type":"short","Value":"1080"} |
| FpsWithSource |
string |
No |
Adapts the output frame rate based on the source's frame rate, while keeping it within a specified range. If specified, it overrides the FPS parameter. Fields:
|
{"UpLimit":60,"LowerLimit":1} |
| BitrateWithSource |
string |
No |
The adaptive bitrate settings. If specified, it overrides the VideoBitrate parameter. Fields:
|
{"UpLimit":2500,"LowerLimit":800,"Factor":1} |
| ExtWithSource |
string |
No |
Other adaptive settings that align the transcoded stream with the source stream. Fields:
|
{"KeyFrameOpen":"yes","Copyts":"yes","SeiMode":1} |
| DeInterlaced |
boolean |
No |
Specifies whether to automatically detect and remove interlacing during transcoding. Deinterlacing converts interlaced video into progressive video.
|
false |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|
||
| RequestId |
string |
The request ID. |
16A96B9A-F203-4EC5-8E43-CB92E68F**** |
Examples
Success response
JSON format
{
"RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68F****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameters | %s | |
| 400 | ConfigAlreadyExists | %s | |
| 400 | TemplateLimit | %s |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.