云转码
构建时从公开 REST 接口定义的 `cloud-transcoding` 标签生成:方法、路径、参数、请求体、响应与 curl。
分组概览
本页由公开 REST 接口定义在构建时生成:标签 cloud-transcoding,共 7 个操作(全量 189 个)。鉴权、信封与分页约定见 REST API 总览.
| 方法 | 路径 | 摘要 |
|---|---|---|
GET | /v1/projects/{appId}/rtls/abr/config/codecs | Query the adaptive-bitrate templates |
POST | /v1/projects/{appId}/rtls/abr/config/codecs/{codecId} | Create or update an adaptive-bitrate template |
POST | /v1/projects/{appId}/rtsc/cloud-transcoder/builderTokens | Acquire a builder token |
POST | /v1/projects/{appId}/rtsc/cloud-transcoder/tasks | Create a cloud transcoding task |
GET | /v1/projects/{appId}/rtsc/cloud-transcoder/tasks/{taskId} | Query the status of a transcoding task |
PATCH | /v1/projects/{appId}/rtsc/cloud-transcoder/tasks/{taskId} | Update a transcoding task |
DELETE | /v1/projects/{appId}/rtsc/cloud-transcoder/tasks/{taskId} | Destroy a transcoding task |
操作详情
GET /v1/projects/{appId}/rtls/abr/config/codecs
Query the adaptive-bitrate templates
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | the templates — object{ status, data } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/v1/projects/appId/rtls/abr/config/codecs" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /v1/projects/{appId}/rtls/abr/config/codecs/{codecId}
Create or update an adaptive-bitrate template
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
codecId | path | 是 | string | 长度 0..64 |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
enabled | boolean | 是 | |
video | object{ width, height, fps } | 是 |
{
"enabled": true,
"video": {
"width": 1,
"height": 1,
"fps": 1
}
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | the template was stored — object{ status } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/v1/projects/appId/rtls/abr/config/codecs/codecId" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"enabled":true,"video":{"width":1,"height":1,"fps":1}}'POST /v1/projects/{appId}/rtsc/cloud-transcoder/builderTokens
Acquire a builder token
Mints a single-use builder token (5 minute validity) that the task endpoints require.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
instanceId | string | 是 | 长度 0..64,pattern ^[A-Za-z0-9_-]+$ |
services | object{ cloudTranscoder } | 是 |
{
"instanceId": "string",
"services": {
"cloudTranscoder": {
"serviceType": "cloudTranscoderV2",
"config": {}
}
}
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | the builder token — object{ createTs, instanceId, tokenName } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/v1/projects/appId/rtsc/cloud-transcoder/builderTokens" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"instanceId":"string","services":{"cloudTranscoder":{"serviceType":"cloudTranscoderV2","config":{}}}}'POST /v1/projects/{appId}/rtsc/cloud-transcoder/tasks
Create a cloud transcoding task
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
builderToken | query | 是 | string |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
services | object{ cloudTranscoder } | 是 | |
instanceId | string | 长度 0..64 |
{
"services": {
"cloudTranscoder": {
"serviceType": "cloudTranscoderV2",
"config": {}
}
},
"instanceId": "string"
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | the transcoding task — object |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/v1/projects/appId/rtsc/cloud-transcoder/tasks?builderToken=value" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"services":{"cloudTranscoder":{"serviceType":"cloudTranscoderV2","config":{}}},"instanceId":"string"}'GET /v1/projects/{appId}/rtsc/cloud-transcoder/tasks/{taskId}
Query the status of a transcoding task
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
taskId | path | 是 | string | 长度 0..128 |
builderToken | query | string |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | the transcoding task — object |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/v1/projects/appId/rtsc/cloud-transcoder/tasks/taskId?builderToken=value" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"PATCH /v1/projects/{appId}/rtsc/cloud-transcoder/tasks/{taskId}
Update a transcoding task
Adds or removes inputs, moves a layout region and updates the output audio/video options of a running task.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
taskId | path | 是 | string | 长度 0..128 |
builderToken | query | 是 | string |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
services | object{ cloudTranscoder } | 是 |
{
"services": {
"cloudTranscoder": {
"serviceType": "cloudTranscoderV2",
"config": {}
}
}
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | the request succeeded; the response body is empty |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X PATCH "$NIMEET_API_BASE/v1/projects/appId/rtsc/cloud-transcoder/tasks/taskId?builderToken=value" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"services":{"cloudTranscoder":{"serviceType":"cloudTranscoderV2","config":{}}}}'DELETE /v1/projects/{appId}/rtsc/cloud-transcoder/tasks/{taskId}
Destroy a transcoding task
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
taskId | path | 是 | string | 长度 0..128 |
builderToken | query | string |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | the stopped transcoding task — object |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X DELETE "$NIMEET_API_BASE/v1/projects/appId/rtsc/cloud-transcoder/tasks/taskId?builderToken=value" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"本分组用到的 Schema
Error — object{ code, message, reason, sdkCode, details }
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | string | 是 | stable machine code, see errors.json |
message | string | 是 | |
reason | string | ||
sdkCode | integer | Agora-aligned client error number | |
details | object |