Adds a custom transcoding configuration for live streams under a streaming domain.

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 AddCustomLiveStreamTranscode

The operation that you want to perform. Set the value to AddCustomLiveStreamTranscode.

App String Yes AppName

The name of the application to which the live stream belongs.

Domain String Yes live.aliyunlive.com

The streaming domain.

Template String Yes LDtest

The name of the custom transcoding template.

Note The name can contain digits, letters, and hyphens (-), and must start with a digit or a letter. The name must be different from the name of the standard transcoding template.
TemplateType String Yes h264

The type of the custom transcoding template. Valid values:

  • h264: H.264
  • h264-nbhd: H.264 Narrowband HD™
  • h265: H.265
  • h265-nbhd: H.265 Narrowband HD™
  • audio: audio-only
Height Integer No 720

The height of the output video. The value of this parameter must meet the following requirements:

  • Height ≥ 100
  • max(Height,Width) ≤ 2560
  • min(Height,Width) ≤ 1440
Note The resolution of a video transcoded by using the H.265 Narrowband HD™ template cannot exceed 1280 × 720 pixels.
Width Integer No 576

The width of the output video. The value of this parameter must meet the following requirements:

  • Width ≥ 100
  • max(Height,Width) ≤ 2560
  • min(Height,Width) ≤ 1440
Note The resolution of a video transcoded by using the H.265 Narrowband HD™ template cannot exceed 1280 × 720 pixels.
FPS Integer No 30

The frame rate of the output video. Unit: FPS. Valid values: 1 to 60.

VideoBitrate Integer No 720

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

Note 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.
AudioBitrate Integer No 512

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

Gop String No 1

The group of pictures (GOP) of the output video. Unit: frame. Valid values: 1 to 3000.

Profile Integer No 2

The video codec profile. The video codec profile determines how ApsaraVideo Live performs codec on the video. In normal cases, a greater value indicates a higher image quality and requires more codec resources. Valid values:

  • 1: baseline, which is suitable for mobile devices
  • 2: main, which is suitable for standard-definition devices
  • 3: high, which is suitable for high-definition devices
AudioProfile String No aac_low

The audio codec profile. Valid values:

  • aac_low
  • aac_he
  • aac_he_v2
  • aac_ld
AudioCodec String No AAC

The audio encoding format. Valid values: AAC and MP3.

AudioRate Integer No 96000

The audio sampling rate. Valid values: 22050 to 96000.

Note If the value of AudioProfile is aac_ld, the audio sampling rate cannot exceed 44100.
AudioChannelNum Integer No 2

The number of audio channels. Valid values:

  • 1: mono
  • 2: binaural
Lazy String No 1

This parameter is reserved.

Response parameters

Parameter Type Example Description
RequestId String 16A96B9A-F203-4EC5-8E43-CB92E68F4CD8

The ID of the request.

Examples

Sample requests

http(s)://live.aliyuncs.com/? Action=AddCustomLiveStreamTranscode
&App=AppName
&Domain=live.aliyunlive.com
&Template=LDtest
&TemplateType=h264
&<Common request parameters>

Sample success responses

XML format

<AddCustomLiveStreamTranscodeResponse>
      <RequestId>16A96B9A-F203-4EC5-8E43-CB92E68F4CD8</RequestId>
</AddCustomLiveStreamTranscodeResponse>

JSON format

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

Error codes

For a list of error codes, visit the API Error Center.