Create Digital Human Video Stream Task
Description
Through this API, you can create a digital human video stream task.
Request prototype
- Request method: POST
- Request body format: JSON
- Request URL: https://aigc-digitalhuman-api.zegotech.cn?Action=CreateDigitalHumanStreamTask
- Transmission protocol: HTTPS
- QPS limit: 10 times/second
Request Parameters
The following request parameter list only shows the API request parameters and some common parameters. For the complete list of common parameters, please refer to Accessing Server APIs - Common Request Parameters.
| Parameter | Type | Required | Description |
|---|---|---|---|
| DigitalHumanConfig | Object | Yes | Digital human configuration. For details, please refer to DigitalHumanConfig. |
| RTCConfig | Object | Yes | RTC configuration. For details, please refer to RTCConfig. |
| TTL | Number | No | Maximum duration of the digital human video stream task. The task will automatically end when the duration reaches this value. The unit is seconds, with a range of [10, 86400]. If not specified, the default value is 86400 seconds (24 hours). |
| MaxIdleTime | Number | No | Maximum idle time of the digital human. The task will automatically end when the idle time reaches this value. The unit is seconds, with a range of [30, 86400]. If not specified, the default value is 900 seconds (15 minutes). |
DigitalHumanConfig
| Parameter | Type | Required | Description |
|---|---|---|---|
| DigitalHumanId | String | Yes | Digital human ID. |
| BackgroundColor | String | No | Background color, in hexadecimal RGB format, such as #ffffff. If not specified, the default value is #000000 (black). |
RTCConfig
| Parameter | Type | Required | Description |
|---|---|---|---|
| RoomId | String | Yes | Target room ID for streaming, with a maximum length of 128 bytes, user-defined input. |
| StreamId | String | Yes | Stream ID, with a maximum length of 128 bytes, only supports numbers, English characters, '-', and '_'. Note Note: StreamId must be globally unique within the AppID, user-defined input. |
Sample request
-
Request URL:
https://aigc-digitalhuman-api.zegotech.cn?Action=CreateDigitalHumanStreamTask &<Common Request Parameters> -
Request body:
{ "DigitalHumanConfig": { "DigitalHumanId": "0d3538a4-9e8e-4155-b1fb-c7defb8eeef8" }, "RTCConfig": { "RoomId": "1234567890", "StreamId": "elias1" } }
Response parameters
| Parameter | Type | Description |
|---|---|---|
| Code | Number | Return code. 0 indicates success, other values indicate failure. For error codes and response handling suggestions, please refer to Return Codes. |
| Message | String | Description of the request result. |
| RequestId | String | Request ID. |
| Data | Object | Return data. |
| └TaskId | String | Digital human video stream task ID. |
Sample response
{
"Code": 0,
"Message": "success",
"RequestId": "d799c85c-10c8-4191-8c6a-3290a5940b5f",
"Data": {
"TaskId": "6a5898fa-3e1d-4a6f-b949-05f39f1c10cb"
}
}