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. |
VideoConfig | Object | Yes | Video configuration. For details, please refer to VideoConfig. |
Assets | Array of Object | Yes | Resources configuration, which can be used to set background images or accessories. For details, please refer to Asset. |
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). |
DigitalHumanConfig
Parameter | Type | Required | Description |
---|---|---|---|
DigitalHumanId | String | Yes | Digital human ID. |
BackgroundColor | String | No | Background color, in hexadecimal RGB format, such as #80ffffff . If not specified, the default value is #00000000 (black). |
Layout | Object | No | Digital human layout. For details, please refer to Layout. |
Layout
Note
The origin (0, 0) of the coordinate system is located at the top left corner of the screen/canvas. The X-axis increases to the right, and the Y-axis increases downward.
Parameter | Type | Required | Description |
---|---|---|---|
Top | Number | Yes | The vertical coordinate of the top left corner of the digital human/resource, in pixels. |
Left | Number | Yes | The horizontal coordinate of the top left corner of the digital human/resource, in pixels. |
Width | Number | Yes | The width of the digital human/resource, in pixels. |
Height | Number | Yes | The height of the digital human/resource, in pixels. |
Layer | Number | No | Digital human/resource layer, must be ≥ 0. The larger the value, the more forward it appears. Default value is 0. |
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. |
VideoConfig
Parameter | Type | Required | Description |
---|---|---|---|
Width | Number | Yes | The width of the video stream, in pixels, with a maximum of 1920. The product of Width and Height must not exceed 1920 × 1080. |
Height | Number | Yes | The height of the video stream, in pixels, with a maximum of 2560. The product of Width and Height must not exceed 1920 × 1080. |
Bitrate | Number | No | The video bitrate, in bps, with a range of [100000, 3000000]. The default value is 3000000. |
Asset
Parameter | Type | Required | Description |
---|---|---|---|
AssetType | Number | Yes | Asset type:
|
AssetUrl | String | Yes | Asset URL, with a maximum length of 1024 bytes. |
Layout | Object | Yes | Asset layout. For details, please refer to Layout. |
Sample request
-
Request URL:
https://aigc-digitalhuman-api.zegotech.cn?Action=CreateDigitalHumanStreamTask &<Common Request Parameters>
-
Request body:
{ "DigitalHumanConfig": { "DigitalHumanId": "0d3538a4-9e8e-4155-b1fb-c7defb8eeef8", "Layout": { "Top": 0, "Left": 0, "Width": 1080, "Height": 1920, "Layer": 2 } }, "RTCConfig": { "RoomId": "1234567890", "StreamId": "elias1" }, "VideoConfig": { "Width": 1080, "Height": 1920 }, "Assets": [ { "AssetType": 1, "AssetUrl": "https://xxx.com/xxx.jpg", "Layout": { "Top": 0, "Left": 0, "Width": 1920, "Height": 1080, "Layer": 1 } } ] }
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"
}
}