Custom transcoding
Create a custom transcoding template
Creates a custom transcoding template for the specified entry point.
HTTP request
Path parameter
Parameter | Type | Description |
---|---|---|
appid | String | Required. The App ID retrieved from Agora Console. |
entry_point | String | Required. The entry point name. |
name | String | Required. The name of the custom transcoding template. This name must be different from the name of any preset transcoding templates; otherwise, an error occurs. |
Request body
The request body is in the JSON Object type, and contains the following fields:
Field | Type | Description |
---|---|---|
width | Integer | Required. The width (pixels) of the video. The value range is [0, 1920], where 0 means to adapt using the original aspect ratio. |
height | Integer | Required. The height (pixels) of the video. The value range is [0,1920], where 0 means to adapt using the original aspect ratio. |
videoCodec | String | Optional. The video encoding format. Only H.264 is supported. If videoBitrate and profile are specified, this field is required. |
videoBitrate | Integer | Optional. The video bitrate (bit/s). The value range is [200, 6000]. |
profile | String | Optional. The encoding profile. Each profile represents a set of encoding parameters. Generally speaking, a higher profile means better video quality and requires more resources for encoding and decoding. Possible values include the following:base : The base profile, which is suitable for mobile devices.main : The standard profile, which is suitable for standard-resolution devices.high : The high profile, which is suitable for high-resolution devices. |
audioCodec | String | Optional. The audio encoding format. Only AAC is supported. If audioBitrate and audioSampleRate are specified, this field is required. |
audioBitrate | Integer | Optional. The audio bitrate (bit/s). The value range is [100,500]. |
audioSampleRate | Integer | Optional. The audio sampling rate (Hz). Possible values include: 96000, 88200, 64000, 48000, 44100, 32000, and 16000. |
HTTP response
If the returned HTTP status code is 200, the request is successful.
If the returned HTTP status code is not 200, the request fails. You can refer to the HTTP status codes for possible reasons.
Example
Request line
Request body
Response line
Update a custom transcoding template
Updates the custom transcoding template for the specified entry point.
HTTP request
Path parameter
Parameter | Type | Description |
---|---|---|
appid | String | Required. The App ID retrieved from Agora Console. |
entry_point | String | Required. The entry point name. |
name | String | Required. The name of the custom transcoding template. |
Request body
The request body is in the JSON Object type, and contains the following fields:
Field | Type | Description |
---|---|---|
width | Integer | Optional. The width (pixels) of the video. The value range is [0, 1920], where 0 means to adapt using the original aspect ratio. If height is specified, this field is required. |
height | Integer | Optional. The height (pixels) of the video. The value range is [0,1920], where 0 means to adapt using the original aspect ratio. If width is specified, this field is required. |
videoCodec | String | Optional. The video encoding format. Only H.264 is supported. If videoBitrate and profile are specified, this field is required. |
videoBitrate | Integer | Optional. The video bitrate (bit/s). The value range is [200, 6000]. |
profile | String | Optional. The encoding profile. Each profile represents a set of encoding parameters. Generally speaking, a higher profile means better video quality and requires more resources for encoding and decoding. Possible values include the following:base : The base profile, which is suitable for mobile devices.main : The standard profile, which is suitable for standard-resolution devices.high : The high profile, which is suitable for high-resolution devices. |
audioCodec | String | Optional. The audio encoding format. Only AAC is supported. If audioBitrate and audioSampleRate are specified, this field is required. |
audioBitrate | Integer | Optional. The audio bitrate (bit/s). The value range is [100,500]. |
audioSampleRate | Integer | Optional. The audio sampling rate (Hz). Possible values include: 96000, 88200, 64000, 48000, 44100, 32000, and 16000. |
HTTP response
If the returned HTTP status code is 200, the request is successful.
If the returned HTTP status code is not 200, the request fails. You can refer to the HTTP status codes for possible reasons.
Example
Request line
Request body
Response line
Delete a custom transcoding template
Deletes the custom transcoding template for the specified entry point.
HTTP request
Path parameter
Parameter | Type | Description |
---|---|---|
appid | String | Required. The App ID retrieved from Agora Console. |
entry_point | String | Required. The entry point name. |
name | String | Required. The name of the custom transcoding template. |
HTTP response
If the returned HTTP status code is 200, the request is successful.
If the returned HTTP status code is not 200, the request fails. You can refer to the HTTP status codes for possible reasons.
Example
Request line
Response line
List custom transcoding templates
Lists the custom transcoding templates for the specified entry point.
HTTP request
Path parameter
Parameter | Type | Description |
---|---|---|
appid | String | Required. The App ID retrieved from Agora Console. |
entry_point | String | Required. The entry point name. |
name | String | Required. The name of the custom transcoding template. |
HTTP response
If the returned HTTP status code is 200, the request is successful. The response body contains the following fields:
transcodeList
: JSON Array. The list of custom transcoding templates for the entry point. Each custom transcoding template corresponds to a JSON Object and contains the following fields:
Field | Type | Description |
---|---|---|
name | String | Required. The transcoding template name. |
width | Integer | Required. The width of the video. |
height | Integer | Required. The height of the video. |
videoCodec | String | Optional. The video encoding format. Only H.264 is supported. |
videoBitrate | Integer | Optional. The video bitrate (bit/s). |
profile | String | Optional. The encoding profile.base : The base profile, which is suitable for mobile devices.main : The standard profile, which is suitable for standard-resolution devices.high : The high profile, which is suitable for high-resolution devices. |
audioCodec | String | Optional. The audio encoding format. Only AAC is supported. |
audioBitrate | Integer | Optional. The audio bitrate (bit/s). |
audioSampleRate | Integer | Optional. The audio sampling rate (Hz). |
If the returned HTTP status code is not 200, the request fails. You can refer to the HTTP status codes for possible reasons.
Example
Request line
Request body
Response line
HTTP status codes
Status code | Description |
---|---|
200 | The request succeeds. |
400 | The parameter is invalid, for example the appid or the entry_point is empty, or the region parameter value is invalid. |
401 | Unauthorized (the customer ID and the customer secret do not match). |
404 | The server cannot find the resource according to the request, which means the requested entry point does not exist or the requested URI path is invalid. |
500 | An internal error occurs in the server, so the server is not able to complete the request. |
504 | An internal error occurs in the server. The gateway or the proxy server did not receive a timely request from the remote server. |