logo
On this page

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.

ParameterTypeRequiredDescription
DigitalHumanConfigObjectYesDigital human configuration. For details, please refer to DigitalHumanConfig.
RTCConfigObjectYesRTC configuration. For details, please refer to RTCConfig.
VideoConfigObjectNoVideo configuration. For details, please refer to VideoConfig.
AssetsArray of ObjectNoResources configuration, which can be used to set background images or accessories. For details, please refer to Asset.
TTLNumberNoMaximum 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

ParameterTypeRequiredDescription
DigitalHumanIdStringYesDigital human ID.
BackgroundColorStringNoBackground color, in hexadecimal RGB format, such as #ffffff. If not specified, the default value is #000000 (black).
LayoutObjectNoDigital 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.
ParameterTypeRequiredDescription
TopNumberNoThe vertical coordinate of the top left corner of the digital human/resource, in pixels.
LeftNumberNoThe horizontal coordinate of the top left corner of the digital human/resource, in pixels.
WidthNumberNoThe width of the digital human/resource, in pixels, with a maximum of 4096.
HeightNumberNoThe height of the digital human/resource, in pixels, with a maximum of 4096.
LayerNumberNoDigital human/resource layer, must be ≥ 0. The larger the value, the more forward it appears. Default value is 0.

RTCConfig

ParameterTypeRequiredDescription
RoomIdStringYesTarget room ID for streaming, with a maximum length of 128 bytes, user-defined input.
StreamIdStringYesStream 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

ParameterTypeRequiredDescription
WidthNumberNoThe width of the video stream, in pixels, with a maximum of 4096.
HeightNumberNoThe height of the video stream, in pixels, with a maximum of 4096.
BitrateNumberNoThe video bitrate, in bps, with a range of [100000, 3000000]. The default value is 3000000.

Asset

ParameterTypeRequiredDescription
AssetTypeNumberYesAsset type:
  • 1: Image.
AssetUrlStringYesAsset URL, with a maximum length of 1024 bytes.
LayoutObjectYesAsset 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"
        },
        "RTCConfig": {
            "RoomId": "1234567890",
            "StreamId": "elias1"
        }
    }

Response parameters

ParameterTypeDescription
CodeNumberReturn code. 0 indicates success, other values indicate failure. For error codes and response handling suggestions, please refer to Return Codes.
MessageStringDescription of the request result.
RequestIdStringRequest ID.
DataObjectReturn data.
└TaskIdStringDigital human video stream task ID.

Sample response

{
    "Code": 0,
    "Message": "success",
    "RequestId": "d799c85c-10c8-4191-8c6a-3290a5940b5f",
    "Data": {
        "TaskId": "6a5898fa-3e1d-4a6f-b949-05f39f1c10cb"
    }
}

Previous

Query Timbre List

Next

Drive Digital Human By Action

On this page

Back to top