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.
VideoConfigObjectYesVideo configuration. For details, please refer to VideoConfig.
AssetsArray of ObjectYesResources 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 #80ffffff. If not specified, the default value is #00000000 (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
TopNumberYesThe vertical coordinate of the top left corner of the digital human/resource, in pixels.
LeftNumberYesThe horizontal coordinate of the top left corner of the digital human/resource, in pixels.
WidthNumberYesThe width of the digital human/resource, in pixels.
HeightNumberYesThe height of the digital human/resource, in pixels.
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
WidthNumberYesThe width of the video stream, in pixels, with a maximum of 1920. The product of Width and Height must not exceed 1920 × 1080.
HeightNumberYesThe height of the video stream, in pixels, with a maximum of 2560. The product of Width and Height must not exceed 1920 × 1080.
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",
            "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

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