配置视频
功能介绍
配置视频的音色、背景、形象和播报样式。
URI
PUT https://{endpoint}/v1/{project_id}/digital-human/video/{video_id}/info
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
tts_config |
是 |
TtsConfig object |
音频配置。 |
video_config |
是 |
VideoConfig object |
背景配置。 如果为空,使用默认背景。 |
character_config |
是 |
CharacterConfig object |
形象设置。 |
read_config |
是 |
ReadConfig object |
播报配置。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
property |
是 |
String |
用于设置音色。取值范围:
|
speed |
是 |
Float |
用户设置音速。 |
volume |
是 |
Integer |
用于设置音量。 |
delay |
是 |
Float |
段首停顿时间。 取值范围:0~60。 单位:秒。 默认值:0。 |
pitch |
否 |
String |
音高。 取值范围: -500~500。 默认值:0。 |
audio_format |
否 |
String |
语音格式头:wav、mp3、pcm。 默认:wav。 |
sample_rate |
否 |
String |
采样率:16000、8000。 默认值:8000。 |
tts_source |
否 |
Integer |
tts来源。
默认值:0。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
background_id |
是 |
String |
背景id。可通过调用获取图片列表接口获取。 |
logo_id |
否 |
String |
图标id。可通过调用获取图片列表接口获取。 |
show_subtitles |
否 |
Boolean |
是否显示字幕。默认值:false。 |
resolution_type |
否 |
Integer |
画面分辨率。
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
character_id |
是 |
String |
形象id。可通过调用获取形象列表接口获取。 |
position |
否 |
Position object |
位置坐标。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
image_read_configs |
否 |
Array of ImageReadConfig objects |
插图播报配置。 |
read_type |
是 |
Integer |
播报选项。
|
read_content |
否 |
String |
纯文本播报内容。长度为1-2500。 |
character_position |
否 |
Integer |
主播位置。
默认值:1。 |
read_content_paragraph_interval |
否 |
Integer |
段落播报间隔。 单位:ms。 取值范围:0~5000。 默认值:400。 |
image_frame_id |
否 |
String |
播报框id。可通过调用获取图片列表接口获取。 |
audio_url |
否 |
String |
用户的音频文件obs地址,为https格式(如:https://cbs-digital-human-cn-north-4.obs.myhuaweicloud.com:443/audio.wav)。当字段不为空时,表示将使用用户自己的音频文件。 不支持PPT和图片播报,不支持字幕。音频格式文件的格式为wav,音频最长支持20分钟,支持100M。该功能的使用需要用户启动OBS授权。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
read_content |
是 |
String |
播报内容,长度为1~2500。 |
image_id |
是 |
String |
图片id。可通过调用获取图片列表接口获取。 |
resolution |
是 |
Resolution object |
图片显示像素(748*420)。 |
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
create_time |
String |
创建时间。 |
update_time |
String |
更新时间。 |
error_msg |
String |
错误信息 如: {"error_code":"0001","error_msg":"播报内容超过10分钟,请重新调整播报内容。"}。 |
id |
String |
视频id。 |
name |
String |
视频名称。 |
progress |
Integer |
视频生成进度。取值范围:0~100。 |
status |
Integer |
视频状态。
|
subtitle_url |
String |
字幕地址。 |
video_url |
String |
视频的obs地址,当视频生成成功时返回。 |
video_shot |
String |
视频截图地址,jpg格式,分辨率480 * 270。当status=2时,表示生成成功时返回。 |
character_config |
CharacterConfig object |
形象设置。 |
compose_actions |
Array of integers |
合成动作,如果不为空,则表示可以进行合成操作。 |
read_config |
ReadConfigResp object |
播报配置。 |
tts_config |
TtsConfig object |
音频配置。 |
video_config |
VideoConfigResp object |
视频配置。 |
参数 |
参数类型 |
描述 |
---|---|---|
image_read_configs |
Array of ImageReadConfigResp objects |
图片播报配置。 |
ppt_read_configs |
Array of PPTReadConfigResp objects |
ppt播报配置。 |
read_type |
Integer |
播报选项: 0:纯文本播报 1:图片播报 2:ppt播报 默认:0 配置哪项会校验哪项是否为空。 |
read_content |
String |
纯文本播报内容。 换行符会按400ms的静音进行分割。 |
character_position |
Integer |
主播位置。
|
read_content_paragragh_times |
Array of integers |
read_content每段播报时间。 |
参数 |
参数类型 |
描述 |
---|---|---|
read_content |
String |
播报内容,长度为1~2500。 |
image_id |
String |
图片id。 |
resolution |
Resolution object |
图片显示像素(748*420)。 |
image_url |
String |
图片地址。 |
name |
String |
图片名。 |
参数 |
参数类型 |
描述 |
---|---|---|
read_content |
String |
播报内容,长度为3~2500。 |
image_id |
String |
PPT转化有的图片id。 |
resolution |
Resolution object |
图片显示像素(748*420)。 |
image_url |
String |
图片地址。 |
name |
String |
图片名。 |
参数 |
参数类型 |
描述 |
---|---|---|
property |
String |
用于设置音色。取值范围:
|
speed |
Float |
用户设置音速。 |
volume |
Integer |
用于设置音量。 |
delay |
Float |
段首停顿时间。 取值范围:0~60。 单位:秒。 默认值:0。 |
pitch |
String |
音高。 取值范围: -500~500 默认值:0。 |
audio_format |
String |
语音格式头,包括wav、mp3、pcm。 默认值:wav。 |
sample_rate |
String |
采样率,包括16000、8000。 默认值:8000。 |
tts_source |
Integer |
tts来源。
默认值:0。 |
参数 |
参数类型 |
描述 |
---|---|---|
background_id |
String |
背景id。可以通过调用获取图片列表获取。 |
logo_id |
String |
图标id。可以通过调用获取图片列表获取。 |
show_subtitles |
Boolean |
是否显示字幕。默认值:false。 |
resolution_type |
Integer |
画面分辨率。 0:宽屏landscape(默认), 1:竖屏portrait。 |
background_url |
String |
背景图片地址,取默认背景的第一张。 |
image_frame_url |
String |
播报框地址 和background绑定,如果使用用户自定义背景,则使用演播厅框。 |
logo_url |
String |
logo地址。 |
状态码: 400
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
错误码 CBS.XXXX。 |
error_msg |
String |
错误详情。 |
状态码: 500
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
错误码 CBS.XXXX。 |
error_msg |
String |
错误详情。 |
请求示例
配置音色为知倩(资讯女声),形象选择小娅正装深色西装站姿,阅读内容第一张图片为“1111213第一段文本播报一下,第一段文本播报一下,第一段文本播报一下,第一段文本播报一下,第一段文本播报一下,第一段文本播报一下”,第二张图片为“看下第二张图片吧111111111”。
PUT https://{endpoint}/v1/{project_id}/digital-human/video/{video_id}/info { "tts_config" : { "speed" : 0, "volume" : 50, "delay" : 0, "audio_format" : "wav", "sample_rate" : "16000", "property" : "zhiqian", "tts_source" : 1 }, "video_config" : { "background_id" : "94e06659-75f6-461a-xxx", "show_subtitles" : false, "resolution_type" : 0 }, "character_config" : { "position" : { "x" : 371, "y" : 950 }, "character_id" : "xiaoya_suit_grey_stand" }, "read_config" : { "image_read_configs" : [ { "resolution" : { "x" : 1102, "y" : 620 }, "image_id" : "d60acfdd-95df-4748-xxx", "read_content" : "1111213第一段文本播报一下,第一段文本播报一下,第一段文本播报一下,第一段文本播报一下,第一段文本播报一下,第一段文本播报一下" }, { "resolution" : { "x" : 1102, "y" : 620 }, "image_id" : "aac35c42-f217-4ead-xxx", "read_content" : "看下第二张图片吧111111111" } ], "read_type" : 1, "character_position" : 0 } }
响应示例
状态码: 200
OK
{ "id" : "05abb2e4-613e-4c42-xxx", "status" : 2, "name" : "ceshi5", "tts_config" : { "speed" : 0.0, "volume" : 50, "delay" : 0.0, "audio_format" : "wav", "sample_rate" : "16000", "property" : "zhiqian", "tts_source" : 1 }, "video_config" : { "background_id" : "94e06659-75f6-461a-xxx", "show_subtitles" : false, "resolution_type" : 0 }, "character_config" : { "position" : { "x" : 371, "y" : 950 }, "character_id" : "xiaoya_suit_grey_stand" }, "read_config" : { "image_read_configs" : [ { "resolution" : { "x" : 1102, "y" : 620 }, "image_id" : "d60acfdd-95df-4748-xxx", "read_content" : "1111213第一段文本播报一下,第一段文本播报一下,第一段文本播报一下,第一段文本播报一下,第一段文本播报一下,第一段文本播报一下", "name" : "fdsa" }, { "resolution" : { "x" : 1102, "y" : 620 }, "image_id" : "aac35c42-f217-4ead-xxx", "read_content" : "看下第二张图片吧111111111", "name" : "1245" } ], "ppt_read_configs" : [ ], "read_type" : 1, "character_position" : 0 } }
状态码: 400
Bad Request
{ "error_code" : "CBS.0003", "error_msg" : "This resource Id:[33dbe0e2-bb9b-4efc-xxx] does not exist." }
状态码: 500
Internal Server Error
{ "error_code" : "CBS.0004", "error_msg" : "Internal Server Error" }
状态码
状态码 |
描述 |
---|---|
200 |
OK |
400 |
Bad Request |
500 |
Internal Server Error |
错误码
请参见错误码。