Template parameters

更新时间:
复制 MD 格式

Define input assets, editing options, and output settings when you create a Bulk Video Creator template through the AddTemplate API.

Important
  • The region in the OSS URL of all media assets must match the region of the OpenAPI service endpoint you are calling.

  • Supported regions: China (Shanghai), China (Beijing), China (Hangzhou), China (Shenzhen), US (Silicon Valley), Singapore.

  • Replace all placeholders in the parameter examples, such as [your-bucket], [your-region-id], [your-file-name], [your-file-path], and media asset IDs (e.g., "****9d46c8b4548681030f6e****"), with your actual values.

Usage note

  • Call the AddTemplate API to create a custom Bulk Video Creator template. For API parameter details, see the AddTemplate section below.

  • To retrieve a specific template, call the GetTemplate API.

  • To retrieve a list of templates, call the ListTemplates API.

AddTemplate

Parameter

Type

Description

Example

Required

Name

String

The template name

batch-editing-template-1

No

Type

String

The template type. For Bulk Video Creator, this must be BatchEditing.

BatchEditing

Yes

Config

JSON

The template configuration parameters

See Config in Parameter examples.

Yes

Config

Parameter

Type

Description

Example

Required

InputTemplateConfig

JSON

Configures parameters such as stickers, background music, and background images.

See InputTemplateConfig in Parameter examples.

No

EditingTemplateConfig

JSON

Configures editing parameters such as titles, voice-overs, background music, and background images.

See EditingTemplateConfig in Parameter examples.

No

OutputTemplateConfig

JSON

Configures output settings such as resolution and video stream parameters.

See OutputTemplateConfig in Parameter examples.

Yes

InputTemplateConfig

Parameter

Type

Description

Example

Required

StickerArray

List<Sticker>

  • Watermarks or logos to add.

  • For supported formats, see Image formats.

[{"MediaId":"****9d46c8b4548681030f6e****","X":10,"Y":100,"Width":300,"Height":300,"Opacity":0.6}]

No

BackgroundMusicArray

List<String>

  • Background music. Supports media asset ID or OSS URL.

  • For supported formats, see Audio formats.

["****b4549d46c88681030f6e****","****549d46c88b4681030f6e****"]

No

BackgroundImageArray

List<String>

  • Background image. Supports media asset ID or OSS URL.

  • For supported formats, see Image formats.

["****b4549d46c88681030f6e****","****549d46c88b4681030f6e****"]

No

EditingTemplateConfig

Parameter

Type

Description

Example

Required

TitleConfig

JSON

Title configuration. Supports subtitle parameter settings.

See TitleConfig example.

No

SubHeadingConfig

JSON

Multi-level subheading configuration. Supports subtitle parameter settings.

JSON fields:

{"1":{"Y":0.3,"FontSize":40},"3":{"Y":0.5,"FontSize":30}}

No

SpeechConfig

JSON

Voiceover script configuration.

Important

The template does not support configuring the Batch video production public parameters parameter.

See SpeechConfig example.

No

BackgroundMusicConfig

JSON

Background music configuration.

See BackgroundMusicConfig example.

No

BackgroundImageConfig

JSON

Background image configuration. Ignored if a background image is already set in InputTemplateConfig.

See BackgroundImageConfig example.

No

FECanvas

JSON

Canvas configuration for front-end page previews.

{"Width": 1080,"Height": 1920}

No

FECanvas

Note

To migrate styles from a common template to a Bulk Video Creator template, copy the FECanvas parameter and the style configuration for titles and subtitles from the common template, then assign them to the TitleConfigSpeechConfig.AsrConfig, and FECanvas parameters. This ensures that subtitle sizes in the preview match the final output.

Parameter

Type

Description

Example

Required

Width

Integer

Canvas width. Unit: pixel.

450

Yes

Height

Integer

Canvas height. Unit: pixel.

800

Yes

OutputTemplateConfig

Parameter

Type

Description

Example

Required

Width

Integer

Output width. Unit: pixel.

1920

Yes

Height

Integer

Output height. Unit: pixel.

1080

Yes

Video

JSONObject

Output video stream configuration, such as Crf and Codec.

{"Crf": 27}

No

Parameter examples

{
  "Name": "batch-editing-template-1",
  "Type": "BatchEditing",
  "Config": {
    "InputTemplateConfig": {
      "BackgroundImageArray": [
        "https://[your-bucket].oss-[your-region-id].aliyuncs.com/[your-file-path]/[your-file-name].png"
      ],
      "BackgroundMusicArray": [
        "icepublic-0c4475c3936f3a8743850f2da942ceee"
      ],
      "StickerArray": [
        {
          "MediaURL": "https://[your-bucket].oss-[your-region-id].aliyuncs.com/[your-file-path]/[your-file-name].jpeg",
          "X": 0.1,
          "Y": 0.1,
          "Width": 0.1,
          "Height": 0.1
        }
      ]
    },
    "EditingTemplateConfig": {
      "TitleConfig": {
        "Y": 0.7
      },
      "SpeechConfig": {
        "Voice": "zhifei",
        "AsrConfig": {
          "Y": 0.9
        }
      }
    },
    "OutputTemplateConfig": {
      "Width": 1080,
      "Height": 1920
    }
  }
}