Updated on 2024-07-04 GMT+08:00

Creating an Asset

Function

Adds and uploads new media assets, including the virtual avatar model, background image, material image and video, and PowerPoint, to the asset library.

  • If the asset type is IMAGE, system_properties is used to classify the background image (BACKGROUND_IMG) and the material image (MATERIAL_IMG).

  • If the asset type is VIDEO, system_properties is used to classify material videos (MATERIAL_VIDEO) and business card videos (BUSSINESS_CARD_VIDEO).

  • system_properties with CREATED_BY_PLATFORM is used to classify VIDEO assets generated by MetaStudio.

Calling Method

For details, see Calling APIs.

URI

POST /v1/{project_id}/digital-assets

Table 1 Path Parameters

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

Table 2 Request header 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-App-UserId

No

String

Third-party user ID, which does not allow Chinese characters.

X-MSS-Authorization

No

String

Internal token of virtual humans.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

asset_name

Yes

String

Asset name.

asset_description

No

String

Asset description.

asset_type

Yes

String

Asset types.

Public asset type. Options:

  • VOICE_MODEL: timbre model (uploaded only by the system administrator and common tenants can only query it)
  • VIDEO: video file
  • IMAGE: image file
  • PPT: slide file
  • MUSIC: music
  • AUDIO: audio
  • COMMON_FILE: common file

Virtual avatar asset. Options:

  • HUMAN_MODEL_2D: virtual avatar model
  • BUSINESS_CARD_TEMPLET: business card template

3D virtual human asset. Options:

  • HUMAN_MODEL: 3D virtual human model
  • SCENE: scene model
  • ANIMATION: animated actions
  • MATERIAL: stylized materials
  • NORMAL_MODEL: normal model

asset_owner

No

String

Project ID.

NOTE:
  • Only the administrator can configure this parameter.

review_config

No

ReviewConfig object

Configures content review.

tags

No

Array of strings

Tags.

asset_extra_meta

No

AssetExtraMeta object

Asset metadata. Sets this parameter based on the asset type.

system_properties

No

Array of SystemProperty objects

Sets system attributes.

shared_config

No

AssetSharedConfig object

Sharing configuration

is_need_generate_cover

No

Boolean

Indicates whether to generate a thumbnail image through the asset library.

NOTE:
  • Available for asset type: VIDEO.

asset_order

No

Integer

Display sequence.

Table 4 ReviewConfig

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.

Table 5 AssetExtraMeta

Parameter

Mandatory

Type

Description

human_model_meta

No

HumanModelAssetMeta object

Virtual human model metadata.

voice_model_meta

No

VoiceModelAssetMeta object

Timbre model metadata.

ppt_meta

No

PPTAssetMeta object

PPT asset metadata information.

animation_meta

No

AnimationAssetMeta object

Animated action asset metadata.

scene_meta

No

SceneAssetMeta object

Scenario metadata.

material_meta

No

MaterialAssetMeta object

Material metadata.

human_model_2d_meta

No

HumanModel2DAssetMeta object

Virtual avatar model metadata

image_meta

No

ImageAssetMeta object

Image metadata

video_meta

No

VideoAssetMeta object

Video metadata, which is automatically extracted.

audio_meta

No

AudioAssetMeta object

Audio metadata, which is automatically extracted.

Table 6 HumanModelAssetMeta

Parameter

Mandatory

Type

Description

style_id

No

String

Virtual human model style ID.

  • system_male_001: male style 01
  • system_female_001: female style 01
  • system_male_002: male style 02
  • system_female_002: female style 02

modeling_type

No

String

Modeling type of the virtual human model.

  • UPLOADED: model uploaded by a tenant
  • PICTURE_MODELING: model generated by photo
  • CHARACTER_CUSTOMIZATION_MODELING: model generated by creating a face avatar

modeling_job_id

No

String

Modeling task ID.

model_properties

No

HumanModelMetaProperties object

Records model configuration information.

components

No

Array of ComponentInfo objects

Replaceable components.

Table 7 HumanModelMetaProperties

Parameter

Mandatory

Type

Description

whole_model_base_file_id

No

String

Indicates the file_id based on which the WHOLE_MODEL in the current model is generated. If the current ID is the same as the file_id of the MAIN file, the WHOLE_MODEL has been generated and does not need to be exported.

load_model_file_id

No

String

file_id used for loading. If the ID is null or no ID is matched, the MAIN file is used.

Table 8 ComponentInfo

Parameter

Mandatory

Type

Description

component_name

Yes

String

Component name.

component_type

Yes

String

Component type.

component_desc

No

String

Component description.

Table 9 VoiceModelAssetMeta

Parameter

Mandatory

Type

Description

order

No

Integer

Display order

model_type

No

String

Timbre asset type.

  • COMMON: general emotion model
  • CLONE: voice cloning model

sex

No

String

Timbre gender.

  • UNKNOW: neutral timbre
  • MALE: male timbre
  • FEMALE: female timbre

The default value is UNKNOW.

language

No

String

Timbre languages:

  • UNKNOW: unknown
  • CN: Chinese
  • EN: English
  • GER: German
  • fr: French
  • Kr: Korean
  • por: Portuguese
  • JPN: Japanese
  • Ita: Italian
  • ESP: Spanish
  • DBH: Northeast China dialect
  • GT: Cantonese & Taiwan dialect
  • GXH: Guangxi dialect
  • HBH: Hubei dialect
  • SXH: Shaanxi dialect
  • SCH: Sichuan dialect
  • YY: Cantonese
  • Russian: Russian
  • Filipino: Tagalog
  • Dutch: Dutch
  • Indonesian: Indonesian
  • Vietnamese: Vietnamese
  • Arabic: Arabic
  • Turkish: Turkish
  • Malay: Malay
  • Thai: Thai
  • Finnish: Finnish

The default value is UNKNOW.

speed_ratio

No

Float

Speech speed zoom ratio

volume_ratio

No

Float

Volume zoom ratio

is_realtime_voice

No

Boolean

Whether the timbre supports real-time compositing. The default value is true.

NOTE:
  • Timbre that supports real-time compositing can be used for livestreaming and intelligent interaction. Timbre that does not support real-time compositing can only be used for video production.

voice_capability

No

VoiceCapability object

Capability set supported by the timbre asset.

NOTE:

The timbre capability set can be queried but cannot be configured.

external_voice_meta

No

ExternalVoiceAssetMeta object

Third-party TTS timbre metadata.

Table 10 VoiceCapability

Parameter

Mandatory

Type

Description

is_support_phoneme_en

No

Boolean

English phonetic symbols are supported.

is_support_phoneme

No

Boolean

Whether multi-pronunciation words are supported.

is_support_break_time

No

Boolean

Whether pauses are supported.

is_support_break_strength

No

Boolean

Whether rhythm is supported.

is_support_speed

No

Boolean

Whether global speaking speed is supported.

is_support_prosody

No

Boolean

Whether local speaking speed is supported.

is_support_ssml_say_as

No

Boolean

Whether the say-as SSML tag is supported.

is_support_ssml_sub

No

Boolean

Whether the sub SSML tag is supported.

is_support_word

No

Boolean

Whether continuous reading is supported.

Table 11 ExternalVoiceAssetMeta

Parameter

Mandatory

Type

Description

provider

Yes

String

Third-party TTS vendor. Options:

  • XIMALAYA: Himalaya
  • HUAWEI_EI: Huawei Cloud EI
  • MOBVOI: Mobvoi
  • AUDIOX: AudioX
  • SINOVOICE: SinoVoice
  • DATABACK: DataBaker
  • AISPEECH: AISpeech
Table 12 PPTAssetMeta

Parameter

Mandatory

Type

Description

auto_analysis

No

Boolean

Indicates whether the PPT needs to be automatically parsed.

ppt_analysis_status

No

String

PPT resolution status.

  • INITIALIZE: initial
  • WAITING: waiting
  • CONVERTING: being parsed
  • FAILED: failed
  • SUCCEEDED: successful
  • CANCELED: canceled

error_info

No

ErrorResponse object

Error information

page_count

No

Integer

Total number of PPT pages.

pages

No

Array of PPTPageInfo objects

PPT page image.

Table 13 PPTPageInfo

Parameter

Mandatory

Type

Description

page_no

No

Integer

Page number.

file_id

No

String

ID of the image file corresponding to the page.

page_content

No

String

Commentary (extracted from remarks).

Table 14 AnimationAssetMeta

Parameter

Mandatory

Type

Description

style_id

No

String

Virtual human model style ID.

duration

No

Float

Animation duration.

auto_analysis

No

Boolean

Indicates whether an action needs to be automatically parsed.

voice_delay

No

Float

Delay duration for playing a voice.

Unit: second

For example, if the entry animation lasts for 3 seconds and voice_delay is set to 4 seconds, the voice is played from the fourth second on after the entry animation starts.

animation_insert_restriction

No

String

Limit on the position where an animation is inserted.

  • ONLY_BEGINNING: During video production, the animation can appear only in the beginning.
  • ONLY_END: During video production, the animation can appear only in the end.
Table 15 SceneAssetMeta

Parameter

Mandatory

Type

Description

components

No

Array of SceneComponentInfo objects

Operable components (such as the screen, light, and camera).

default_configs

No

Map<String,SceneComponentInfo>

Default scene settings (camera position and initial person position).

Table 16 SceneComponentInfo

Parameter

Mandatory

Type

Description

index

No

Integer

Component index.

component_name

Yes

String

Component name.

component_type

Yes

String

Component type.

  • CAMERA: camera
  • PANEL: screen
  • LIGHT: light

component_desc

No

String

Component description.

Table 17 MaterialAssetMeta

Parameter

Mandatory

Type

Description

components

No

Array of MaterialComponentInfo objects

Replaceable material components.

Table 18 MaterialComponentInfo

Parameter

Mandatory

Type

Description

component_name

Yes

String

Material component name.

component_type

Yes

String

Material component type.

  • CLOTHES: clothes
  • PANTS: pants
  • SHOES: shoes
  • HAIR: hair
  • EYELASH: eyelashes
  • EYEBROW: eyebrows

component_desc

No

String

Material component description.

Table 19 HumanModel2DAssetMeta

Parameter

Mandatory

Type

Description

is_action_editable

No

Boolean

Indicates whether the action of a virtual avatar can be edited (Uneditable by default).

is_real_background

No

Boolean

Indicates whether a virtual avatar is in a real scene. The real scene will not be replaced.

support_live

No

Boolean

Indicates whether livestream is supported.

model_version

No

String

Virtual avatar model version. By default, the V2 model is used.

  • V2: V2 model
  • V3: V3 model
  • V3_2: V3.2 model

model_resolution

No

String

Virtual avatar model resolution. The default value is 1080P.

  • 1080P: supports 1080P and 720P video output.
  • 4K: supports 4K, 1080P, and 720P video output.

device_names

No

Array of strings

The compilation task has been executed.

Table 20 ImageAssetMeta

Parameter

Mandatory

Type

Description

codec

No

String

Image encoding format, which is automatically extracted.

width

No

Integer

Image width, which is automatically extracted.

height

No

Integer

Image height, which is automatically extracted.

size

No

Number

Size

mode

No

String

Horizontal; Vertical

error_info

No

ErrorResponse object

Error message

Table 21 VideoAssetMeta

Parameter

Mandatory

Type

Description

video_codec

No

String

Video encoding format

width

No

Integer

Video width

height

No

Integer

Video height

frame_rate

No

String

Frame rate

video_bit_rate

No

Integer

Average video bitrate, in kbit/s.

duration

No

Integer

Duration, in second.

audio_codec

No

String

Audio encoding format

audio_bit_rate

No

Integer

Average audio bitrate, in kbit/s.

audio_channels

No

Integer

Number of audio channels

sample

No

Integer

Sampling rate, in Hz.

mode

No

String

Horizontal; Vertical

video_transcoding_status

No

String

Video transcoding status.

  • WAITING
  • TRANSCODING
  • FAILED
  • SUCCEEDED

error_info

No

ErrorResponse object

Error message

Table 22 AudioAssetMeta

Parameter

Mandatory

Type

Description

duration

No

Integer

Duration, in second.

audio_codec

No

String

Audio encoding format

audio_bit_rate

No

Integer

Average audio bitrate, in kbit/s.

audio_channels

No

Integer

Number of audio channels

sample

No

Integer

Sampling rate, in Hz.

error_info

No

ErrorResponse object

Error message

Table 23 ErrorResponse

Parameter

Mandatory

Type

Description

error_code

No

String

Error code.

error_msg

No

String

Error description.

Table 24 SystemProperty

Parameter

Mandatory

Type

Description

action

No

String

Operations.

  • ADD: add
  • DELETE: delete

key

No

String

System attribute.

Public asset attribute. Options:

  • BACKGROUND_IMG: 2D background image for video production. Set value to Yes.
  • CREATED_BY_PLATFORM: whether it is generated by the platform

Virtual avatar asset attribute. Options:

  • MATERIAL_IMG: image used as the foreground. Set value to Yes.
  • MATERIAL_VIDEO: video used as the foreground. Set value to Yes.
  • BUSINESS_CARD_VIDEO: business card video
  • TO_BE_TRANSLATED_VIDEO: source video for translation. The value can be Yes.

3D virtual human asset attribute. Options:

  • STYLE_ID: style ID
  • DH_ID: virtual human ID (not available yet)
  • PLATFORM_AVAILABLE: whether the platform is available (not available yet)
  • RENDER_ENGINE: engine type. Set value to UE or MetaEngine.
  • BACKGROUND_SCENE: 2D background scene for video production. Set value to Horizontal or Vertical.
  • LAYER_CONFIG_ENABLE: available foreground layer configuration

value

No

String

Attribute value.

Table 25 AssetSharedConfig

Parameter

Mandatory

Type

Description

shared_type

No

String

Sharing type.

  • PRIVATE: accessible only to the current tenant
  • PUBLIC: accessible to all tenants. Currently, only system assets are accessible to all tenants.
  • SHARED: accessible to specified tenants, who are specified by the owner.

expire_time

No

String

Time when the sharing expires. The default value is 30 days, that is, 23:59:59 on the day when sharing starts plus 30 days.

allowed_project_ids

No

Array of strings

Tenants allowed to access the asset.

Response Parameters

Status code: 200

Table 26 Response header parameters

Parameter

Type

Description

X-Request-Id

String

Request ID.

Table 27 Response body parameters

Parameter

Type

Description

asset_id

String

Digital asset ID.

Status code: 400

Table 28 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

POST https://{endpoint}/v1/6a6a1f8354f64dd9b9a614def7b59d83/digital-assets

{
  "asset_name" : "Sara Model",
  "asset_description" : "Virtual employee",
  "asset_type" : "HUMAN_MODEL",
  "tags" : [ "Virtual employee" ]
}

Example Responses

Status code: 200

Successful.

{
  "asset_id" : "93769b5a-c8c6-4692-9c95-53933a1f0c93"
}

Status code: 400

{
  "error_code" : "MSS.00000003",
  "error_msg" : "Invalid parameter"
}

Status Codes

Status Code

Description

200

Successful.

400

Parameters error, including the error code and its description.

Error Codes

See Error Codes.