Creating a Video Script
Function
Creates a video script.
Calling Method
For details, see Calling APIs.
URI
POST /v1/{project_id}/digital-human-video-scripts
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
No |
String |
User token. This parameter is mandatory when token authentication is used. You can obtain the token by calling the IAM API used to obtain a user token. Value of X-Subject-Token in the response header. |
Authorization |
No |
String |
Authentication information. This parameter is mandatory for AK/SK authentication. |
X-Sdk-Date |
No |
String |
Time when the request is sent. This parameter is mandatory for AK/SK authentication. The format is YYYYMMDD'T'HHMMSS'Z'. |
X-Project-Id |
No |
String |
Project ID. This parameter is mandatory for AK/SK authentication. |
X-App-UserId |
No |
String |
Third-party user ID, which does not allow Chinese characters. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
script_name |
Yes |
String |
Script name. |
script_description |
No |
String |
Script description. |
view_mode |
No |
String |
Landscape or portrait mode. The default value is LANDSCAPE.
|
model_asset_id |
No |
String |
Virtual human model asset ID |
model_asset_type |
No |
String |
Virtual human model type.
|
voice_config |
No |
VoiceConfig object |
Voice configuration parameter. |
video_config |
No |
VideoConfig object |
Video output configuration. |
scene_asset_id |
No |
String |
Asset ID of a scene.
NOTE:
|
priv_data |
No |
String |
Private data, which is entered by the user and then returned with the same content. |
background_music_config |
No |
BackgroundMusicConfig object |
Background music configuration.
NOTE:
|
review_config |
No |
ReviewConfig object |
Content review configuration. |
shoot_scripts |
Yes |
Array of ShootScriptItem objects |
Video shooting scripts. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
voice_asset_id |
Yes |
String |
Timbre asset ID. |
speed |
No |
Integer |
Speech speed. The value defaults to 100 and ranges from 50 to 200.
NOTE:
|
pitch |
No |
Integer |
Pitch. The value defaults to 100 and ranges from 50 to 200. |
volume |
No |
Integer |
Volume. The value defaults to 140 and ranges from 90 to 240. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
clip_mode |
No |
String |
Clipping mode of the output video. Default value: RESIZE.
|
codec |
Yes |
String |
Video encoding format and video file format.
|
bitrate |
Yes |
Integer |
Average output bitrate. Unit: kbit/s The value ranges from 40 to 30,000.
NOTE:
|
width |
Yes |
Integer |
Video width. Unit: pixel.
NOTE:
|
height |
Yes |
Integer |
Video height. Unit: pixel.
NOTE:
|
frame_rate |
No |
String |
Frame rate. Unit: FPS
NOTE:
|
is_subtitle_enable |
No |
Boolean |
Whether the output video is subtitled. The default value is false.
|
subtitle_config |
No |
SubtitleConfig object |
Subtitle configuration. |
dx |
No |
Integer |
Coordinates of the pixel in the upper left corner of the cropped video. This parameter takes effect when clip_mode is set to crop.
NOTE:
|
dy |
No |
Integer |
Coordinates of the pixel in the upper left corner of the cropped video. This parameter takes effect when clip_mode is set to crop.
NOTE:
|
is_enable_super_resolution |
No |
Boolean |
Whether super resolution is enabled for a video.
NOTE:
true: enable false: do not enable |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
dx |
No |
Integer |
Coordinates of the pixel in the lower left corner of the subtitle.
NOTE:
|
dy |
No |
Integer |
Coordinates of the pixel in the lower left corner of the subtitle.
NOTE:
|
font_name |
No |
String |
Font. The following fonts are supported:
|
font_size |
No |
Integer |
Font size. The value ranges from 4 to 120. |
h |
No |
Integer |
Subtitle box height
NOTE:
|
w |
No |
Integer |
Subtitle box width
NOTE:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
music_asset_id |
No |
String |
Music asset ID. |
volume |
No |
Integer |
Music volume. For example, 100 indicates that the volume is 100%, and 50 indicates that the volume is 50%. The value defaults to 100 and ranges from 0 to 100. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
no_need_review |
No |
Boolean |
Content review whitelist. This feature is available only for users in the whitelist. The auto review policies apply to other users. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
sequence_no |
No |
Integer |
Script No. |
shoot_script |
Yes |
ShootScript object |
Performance script. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
script_type |
No |
String |
Script type, that is, the control mode of video production. The default value is TEXT. TEXT: text control, that is, voice compositing through TTS AUDIO: speech control |
text_config |
No |
TextConfig object |
Commentary configuration. |
background_config |
No |
Array of BackgroundConfigInfo objects |
Background configuration. |
layer_config |
No |
Array of LayerConfig objects |
Layer configuration. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
text |
Yes |
String |
Script. Two modes are supported: plain text mode and tag mode. Plain text mode Plain text mode, for example, "Hello, everyone, I'm a virtual streamer." Tag mode For details about the definition of SSML tags, see SSML Definition of Text Control. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
background_type |
Yes |
String |
Background type.
NOTE:
|
background_config |
No |
String |
Background file URL.
NOTE:
|
background_color_config |
No |
String |
RGB color value of a solid color background.
NOTE:
|
background_asset_id |
No |
String |
Background asset ID.
NOTE:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
layer_type |
Yes |
String |
Layer type.
|
asset_id |
No |
String |
ID of the asset overlaid on a video. You do not need to set this parameter for external assets. |
group_id |
No |
String |
Groups materials in multiple scenes. Materials with the same group_id share location information when they are applied globally. |
position |
No |
LayerPositionConfig object |
Layer position configuration. |
size |
No |
LayerSizeConfig object |
Layer size configuration. |
image_config |
No |
ImageLayerConfig object |
Material image layer configuration. |
video_config |
No |
VideoLayerConfig object |
Material video layer configuration. |
text_config |
No |
TextLayerConfig object |
Material text layer configuration. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
dx |
Yes |
Integer |
X axis position of the pixel in the upper left corner of the image. The coordinate of the upper left corner of the canvas is 0x0.
NOTE:
|
dy |
Yes |
Integer |
Y axis position of the pixel in the upper left corner of the image. The coordinate of the upper left corner of the canvas is 0x0.
NOTE:
The canvas resolution is 1920 x 1080 in landscape mode (16:9) and 1080 x 1920 in portrait mode (9:16). |
layer_index |
Yes |
Integer |
Layer sequence of an image, video, or person image.
NOTE:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
width |
No |
Integer |
Width (in pixel) of the layer image (relative to the canvas size).
NOTE:
The canvas resolution is 1920 x 1080 in landscape mode (16:9) and 1080 x 1920 in portrait mode (9:16). |
height |
No |
Integer |
Height (in pixel) of the layer image (relative to the canvas size).
NOTE:
The canvas resolution is 1920 x 1080 in landscape mode (16:9) and 1080 x 1920 in portrait mode (9:16). |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
video_url |
No |
String |
Video file URL. |
video_cover_url |
No |
String |
Video thumbnail file URL. |
loop_count |
No |
Integer |
Number of times that a video is played cyclically. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
text_context |
No |
String |
Text of the text layer. The content must be encoded using Base64. For example, if you want to add the text watermark "Test text watermark", set text_context to 5rWL6K+V5paH5a2X5rC05Y2w. |
font_name |
No |
String |
Font. The following fonts are supported:
|
font_size |
No |
Integer |
Font size (pixel). The value ranges from 4 to 120. |
font_color |
No |
String |
Font color. RGB color value. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
X-Request-Id |
String |
Request ID. |
Parameter |
Type |
Description |
---|---|---|
script_id |
String |
Script ID. |
audio_files |
ShootScriptAudioFiles object |
URLs for uploading audio files for speech control |
Parameter |
Type |
Description |
---|---|---|
audio_file_url |
Array of ShootScriptAudioFileItem objects |
URLs for uploading audio files for speech control |
Parameter |
Type |
Description |
---|---|---|
sequence_no |
Integer |
Script No. |
audio_file_upload_url |
String |
URL for uploading the audio file for speech control. It is returned when a script is created or updated. The maximum size of a single file is 100 MB. MP3/WAV/M4A files can be uploaded. |
audio_file_download_url |
String |
URL for downloading the audio file for speech control. It is returned when script details are queried. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error description. |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error description. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error description. |
Example Requests
POST https://{endpoint}/v1/70b76xxxxxx34253880af501cdxxxxxx/digital-human-video-scripts { "script_name" : "The Legend of Nature", "script_description" : "Courseware", "model_asset_id" : "a5d295cdb345c11bd9f36bc22ced3a7a", "scene_asset_id" : "7ad01cf66f6cc54e45a2021558b7fbb0", "voice_config" : { "voice_asset_id" : "a5d295cdb345c11bd9f36bc22ced3a7a" }, "video_config" : { "codec" : "H264", "bitrate" : 4000, "frame_rate" : "25", "width" : 1920, "height" : 1080 }, "shoot_scripts" : [ { "sequence_no" : 0, "shoot_script" : { "text_config" : { "text" : "Hello, everyone. I'm Sara." }, "animation_config" : [ { "animation" : "7affc1c9d10b9779957fce7d4aecbd35" } ], "background_config" : [ { "background_type" : "IMAGE", "background_config" : "978f893e1de4553c183b7a805e6290f5" } ] } } ] }
Example Responses
Status code: 200
Succeeded.
{ "script_id" : "26f06524-4f75-4b3a-a853-b649a21aaf66" }
Status code: 400
{ "error_code" : "MSS.00000003", "error_msg" : "Invalid parameter" }
Status code: 401
{ "error_code" : "MSS.00000001", "error_msg" : "Unauthorized" }
Status code: 500
{ "error_code" : "MSS.00000004", "error_msg" : "Internal Error" }
Status Codes
Status Code |
Description |
---|---|
200 |
Succeeded. |
400 |
Parameters error, including the error code and its description. |
401 |
Authentication is not performed or fails. |
500 |
Internal service error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot