以人声音频或文本作为输入,渲染虚拟人视频。
接口说明
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ice:SubmitAvatarVideoJob |
create |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| InputConfig |
string |
否 |
虚拟人任务输入参数。支持以文本、音频 OSS 文件、媒资作为输入。音频仅支持 mp3 或 wav 格式。 重要 Text 的输入内容长度不能少于 5 个字。 |
{"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 |
否 |
虚拟人任务配置信息,支持设置虚拟人 id、人声、语速等信息 |
{"AvatarId":"yunqiao"} |
| OutputConfig |
string |
否 |
任务输出信息,支持设置输出地址 |
{"MediaURL":"https://your-bucket.oss-cn-shanghai.aliyuncs.com/xxx.mp4"} |
| Title |
string |
否 |
任务标题,长度不超过 128 字节 |
Test Title |
| Description |
string |
否 |
任务描述,长度不超过 128 字节 |
Test Description |
| UserData |
string |
否 |
用户自定义设置,可传入客户业务信息,如业务方环境、任务信息,JSON 字符串格式。 |
{"user":"data","env":"prod"} |
InputConfig 示例:
输入为音频地址:
{
"InputFile": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/xxx.mp3"
}
输入为文本:
{
"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."
}
输入为 MediaId:
{
"MediaId": "4aef0c80cc0071edbf92f6e7c44b6302"
}
EditingConfig 示例:
AvatarId:虚拟人形象 Id,必填 ,取值:数字人官方形象
Voice:发音人,仅输入为 Text 有效,选填,取值:智能语音效果示例
CustomizedVoice:个性化人声。如果需要使用通过人声克隆生成的个性化人声作为发音人,请使用此字段,而不是 Voice 字段
LoopMotion: 是否首尾同帧,如果设置此值为 true,则生成的数字人视频图像的首帧与尾帧相同,循环播放视频时人物形象的动作和表情不会有“跳变”现象,取值范围:{true, false},默认值:false
SpeechRate:语速,仅当输入为文本类型有效,取值范围:-500~500,默认值:0
PitchRate:音调,仅当输入为文本类型有效,取值范围:-500~500,默认值:0
Volume:音量,仅当输入为文本类型有效,取值范围:0~100,默认值 50
BackgroundUrl:背景图,选填,不传默认是黑色背景,仅支持 jpg、png 格式;分辨率要求为 1080P,如果使用的是竖屏形象,则要求为 1080P 竖屏,如果使用的是横屏形象,则要求为 1080P 横屏。
{
"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 示例:
{
"MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/xxx.mp4
}
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| RequestId |
string |
Id of the request |
******11-DB8D-4A9A-875B-275798****** |
| JobId |
string |
智能任务 Id |
****20b48fb04483915d4f2cd8ac**** |
| MediaId |
string |
成片媒资 id |
******70dcc471edaf00e6f6f4****** |
可以通过获取智能任务结果接口查询任务执行状态和任务结果,任务执行成功时接口返回结果示例如下.
{
"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\\\":\\\"君不见黄河之水天上来,奔流到海不复回。\\\"},{\\\"from\\\":4.692,\\\"to\\\":9.061,\\\"content\\\":\\\"君不见高堂明镜悲白发,朝如青丝暮成雪。\\\"}]\"}"
}
}
其中,AiResult 格式如下:
outputVideoUrl 为输出成片地址,mp4 格式
subtitleClips 字幕句子时间戳
{
"outputVideoUrl": "https://oushu-test-shanghai.oss-cn-shanghai.aliyuncs.com/avatar/222.mp4",
"subtitleClips": "[{\"from\":0.0,\"to\":4.692,\"content\":\"君不见黄河之水天上来,奔流到海不复回。\"},{\"from\":4.692,\"to\":9.061,\"content\":\"君不见高堂明镜悲白发,朝如青丝暮成雪。\"}]"
}
示例
正常返回示例
JSON格式
{
"RequestId": "******11-DB8D-4A9A-875B-275798******\n",
"JobId": "****20b48fb04483915d4f2cd8ac****\n",
"MediaId": "******70dcc471edaf00e6f6f4******"
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。