SubmitAvatarVideoJob

Updated at:

Renders a digital human video by using human voice audio or text as input.

Operation description

  • This operation is an asynchronous operation. After a node is committed, a node ID is returned. The node is not completed immediately and enters a background queue to execute asynchronously. The final result is sent through a callback notification. You can also call the Get smart node task result operation to query the node status.

  • Currently, only text or human voice audio is supported as input. Audio files support only the MP3 or WAV format.

  • Both MP4 and WebM output formats are supported. When the output format is MP4, the final video has a green screen background, and a mask video of the virtual human is also generated for subsequent use. This method is recommended. When the output format is WebM, the final video is a WebM file with a transparent channel, which is active for frontend display. However, the synthesis is slower due to WebM encoding issues.

  • The output result includes sentence UNIX timestamps of the human voice for subsequent use in editing.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ice:SubmitAvatarVideoJob

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

InputConfig

string

No

The input parameters for the digital human task. Text, audio files stored in OSS, and media assets are supported as input. Audio files support only the MP3 or WAV format.

Important The length of the input text cannot be less than 5 characters.

{"Text": "Do you not see the Yellow River's waters descending from heaven, rushing to the sea never to return.Do you not see in the bright mirror of the high hall, the sad sight of white hair,Hair turns from black to white in the course of a day."}

EditingConfig

string

No

The configuration information for the digital human task. You can configure information such as the digital human ID, voice, and speech rate.

{"AvatarId":"yunqiao"}

OutputConfig

string

No

The output information of the task. You can configure the output address.

{"MediaURL":"https://your-bucket.oss-cn-shanghai.aliyuncs.com/xxx.mp4"}

Title

string

No

The title of the task. The title can be up to 128 bytes in length.

Test Title

Description

string

No

The description of the task. The description can be up to 128 bytes in length.

Test Description

UserData

string

No

The custom settings of the user. You can pass in customer business information, such as the business environment and task information, in JSON string format.

{"user":"data","env":"prod"}

InputConfig example:

Input as an audio URL:

{
  "InputFile": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/xxx.mp3"
}

Input as text:

{
  "Text": "Do you not see the Yellow River's waters descending from heaven, rushing to the sea never to return.Do you not see in the bright mirror of the high hall, the sad sight of white hair,Hair turns from black to white in the course of a day."
}

Input as a MediaId:

{
  "MediaId": "4aef0c80cc0071edbf92f6e7c44b6302"
}

EditingConfig example:

AvatarId: the ID of the digital human avatar. Required. Valid values: Official digital human avatars.
Voice: the voice actor. Valid only when the input is text. Optional. Valid values: Intelligent speech effect examples.
CustomizedVoice: the customized voice. If you need to use a customized voice generated through voice cloning as the voice actor, use this field instead of the Voice field.
LoopMotion: specifies whether the first and last frames are identical. If this parameter is set to true, the first and last frames of the generated digital human video are the same. When the video is played in a loop, there is no sudden jump in the movements and expressions of the character. Valid values: true and false. Default value: false.
SpeechRate: the speech rate. Valid only when the input is text. Valid values: -500 to 500. Default value: 0.
PitchRate: the pitch. Valid only when the input is text. Valid values: -500 to 500. Default value: 0.
Volume: the volume. Valid only when the input is text. Valid values: 0 to 100. Default value: 50.
BackgroundUrl: the background image. Optional. If this parameter is not specified, a black background is used by default. Only the JPG and PNG formats are supported. The resolution must be 1080p. If a portrait avatar is used, the resolution must be 1080p portrait. If a landscape avatar is used, the resolution must be 1080p landscape.



















{
  "AvatarId": "xinxin-marketing_standing", 
  "BackgroundUrl": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/xxx.jpg",
  "Voice" : "zhichu",
  "LoopMotion": true,
  "SpeechRate": 100,
  "PitchRate": 10, 
  "Volume": 10 
}

OutputConfig example:

{
  "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/xxx.mp4"
}

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

Id of the request

******11-DB8D-4A9A-875B-275798******

JobId

string

The ID of the smart job.

****20b48fb04483915d4f2cd8ac****

MediaId

string

The media asset ID of the final video.

******70dcc471edaf00e6f6f4******

You can call the Get smart node task result operation to query the node execute status and task result. The following example shows the response when the node executes successfully:

{
	"RequestId": "2014D1A8-4143-164F-94B4-32B8F39B706D",
	"JobId": "d9367da8c7184ec7a3f24de530ac5b9a",
	"State": "Finished",
	"SmartJobInfo": {
		"Title": "default_title_2023-03-28T13:37:47Z",
		"EditingConfig": "null",
		"JobType": "AvatarVideo",
		"CreateTime": "2023-03-28T13:37:47Z",
		"ModifiedTime": "2023-03-28T13:37:47Z",
		"UserId": 1833202230108227,
		"outputConfig": {
			"mediaUrl": "https://oushu-test-shanghai.oss-cn-shanghai.aliyuncs.com/avatar/222.mp4"
		}
	},
	"JobResult": {
		"MediaId": "4aef0c80cc0071edbf92f6e7c44b6302",
		"AiResult": "{\"outputVideoUrl\":\"https://oushu-test-shanghai.oss-cn-shanghai.aliyuncs.com/avatar/222.mp4\",\"subtitleClips\":\"[{\\\"from\\\":0.0,\\\"to\\\":4.692,\\\"content\\\":\\\"Do you not see the Yellow River's waters descending from heaven, rushing to the sea never to return.\\\"},{\\\"from\\\":4.692,\\\"to\\\":9.061,\\\"content\\\":\\\"Do you not see in the bright mirror of the high hall, the sad sight of white hair,Hair turns from black to white in the course of a day.\\\"}]\"}"
	}
}

The format of AiResult is as follows:
outputVideoUrl: the URL of the output final video, in MP4 format.
subtitleClips: the sentence timestamps of the subtitles.




{
	"outputVideoUrl": "https://oushu-test-shanghai.oss-cn-shanghai.aliyuncs.com/avatar/222.mp4",
	"subtitleClips": "[{\"from\":0.0,\"to\":4.692,\"content\":\"Do you not see the Yellow River's waters descending from heaven, rushing to the sea never to return.\"},{\"from\":4.692,\"to\":9.061,\"content\":\"Do you not see in the bright mirror of the high hall, the sad sight of white hair,Hair turns from black to white in the course of a day.\"}]"
}

Examples

Success response

JSON format

{
  "RequestId": "******11-DB8D-4A9A-875B-275798******\n",
  "JobId": "****20b48fb04483915d4f2cd8ac****\n",
  "MediaId": "******70dcc471edaf00e6f6f4******"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.