Built-in Template Parameters

This topic describes the parameter settings of Data+ action templates and customized functions.

The following action templates are supported:

Different regions support different templates. Check specific templates available in each region on OBS Console.

Table 1 Data+ function templates

Category

Template Name

Image processing

Image Tagging

Video processing

Video Parsing

Frame Capturing

Media Transcoding

Message notifications

DIS Message Notification

SMN Message Notice

Content moderation

Video Content Moderation

Other

Event Delay

Custom Functions

Image Tagging

This template accurately identifies hundreds of scenes and thousands of common objects and their attributes in natural images. It makes functions such as smart album management more intuitive. This template invokes the Image tagging API of Image Recognition servcie.

Table 2 Image tagging parameters

Type

Parameter Name

Description

Basic Parameters

Action

Action name displayed under the icon in the workflow orchestration area

  • An action name starts with a letter or digit.
  • Only letters, digits, underscores (_), and hyphens (-) are allowed.
  • An action name length is between 1 to 20 characters.
  • Each action name is unique in a workflow.

Timeout (s)

Timeout interval of an action, or the maximum duration of an action

The value ranges from 0 to 300 seconds. If the value is set to 0, it indicates the timeout interval is 30 seconds by default.

Action Provider

Provider of the selected action template

Error Handling

You can specify the number of retry attempts, interval between retry attempts, and the next action if all retry attempts fail.

Error types include: match any, execution failed, invalid permission, invalid parameter, nonexistent function, too many requests, unavailable function, and function exception.

Dynamic Parameters

tag_threshold

Threshold of the confidence score. The value ranges from 0 to 100. If you input a value beyond the value range, the default value is used. Default value: 0

tag_limit

The maximum number of returned tags. The default value is 30.

tag_language

zh: The language of the returned tag is Chinese.

en: The language of the returned tag is English.

Video Parsing

This action template is used to create a video parsing task to parse video metadata. This action calls the API of Media Processing Center (MPC) for creating a video parsing task.

Table 3 Video parsing parameters

Type

Parameter Name

Description

Basic Parameters

Action

Action name displayed under the icon in the workflow orchestration area

  • An action name starts with a letter or digit.
  • Only letters, digits, underscores (_), and hyphens (-) are allowed.
  • An action name length is between 1 to 20 characters.
  • Each action name is unique in a workflow.

Timeout (s)

Timeout interval of an action, or the maximum duration of an action

The value ranges from 0 to 300 seconds. If the value is set to 0, it indicates the timeout interval is 30 seconds by default.

Action Provider

Provider of the selected action template

Error Handling

You can specify the number of retry attempts, interval between retry attempts, and the next action if all retry attempts fail.

Error types include: match any, execution failed, invalid permission, invalid parameter, nonexistent function, too many requests, unavailable function, and function exception.

Dynamic Parameters

metadata_sync

Video parsing mode.

  • Queued processing: Only the action ID is returned following a query. To obtain the video metadata, the action will further call the API for querying video parsing tasks.
  • Synchronized processing: Video metadata is returned following a query.

metadata_outbucket

The bucket for storing output videos after parsing.

The output bucket and the Data+ workflow must be in the same region. A Data+ workflow is in the region of the bucket for which the workflow is created. If workflow A is created for bucket A, workflow A is in the region where bucket A is located.

metadata_outpath

Directory for storing videos in the video parsing output bucket.

For example, if you enter abc or abc/, the output videos are saved in the abc folder in the output bucket. If the abc folder does not exist, the system automatically creates it. If this parameter is not specified, videos are stored in the root directory of the output bucket.

Frame Capturing

This action template is used to create a video frame capturing task. This action calls the API of MPC for creating a snapshot task.

Table 4 Frame capturing parameters

Type

Parameter Name

Description

Basic Parameters

Action

Action name displayed under the icon in the workflow orchestration area

  • An action name starts with a letter or digit.
  • Only letters, digits, underscores (_), and hyphens (-) are allowed.
  • An action name length is between 1 to 20 characters.
  • Each action name is unique in a workflow.

Timeout (s)

Timeout interval of an action, or the maximum duration of an action

The value ranges from 0 to 300 seconds. If the value is set to 0, it indicates the timeout interval is 30 seconds by default.

Action Provider

Provider of the selected action template

Error Handling

You can specify the number of retry attempts, interval between retry attempts, and the next action if all retry attempts fail.

Error types include: match any, execution failed, invalid permission, invalid parameter, nonexistent function, too many requests, unavailable function, and function exception.

Dynamic Parameters

thumb_output_bucket

The bucket for storing output frames.

The output bucket and the Data+ workflow must be in the same region. A Data+ workflow is in the region of the bucket for which the workflow is created. If workflow A is created for bucket A, workflow A is in the region where bucket A is located.

thumb_output_path

Directory for storing frames in the frame output bucket.

For example, if you enter abc or abc/, the output videos are saved in the abc folder in the output bucket. If the abc folder does not exist, the system automatically creates it. If this parameter is not specified, videos are stored in the root directory of the output bucket.

thumb_samp_tar

Whether to compress captured frames to a TAR package.

thumb_samp_sync

Whether to enable synchronous processing. Synchronous processing refers to quickly locating the position to capture a frame.

thumb_samp_type

Sampling type. The options are as follows:

  • Snapshots are captured based on a percentage of the video duration.
  • Snapshots are captured at certain intervals.
  • Snapshots are captured a fixed time point.

thumb_samp_filename

Name of the captured frame file.

  • If only one image is captured (one time point is specified in the DOTS mode), the captured frame is output with the specified file name.
  • If multiple frames are captured (multiple time points in the DOTS mode or frame capturing in the TIME mode), the captured frames are output with the specified file name plus the time points (for example, output_filename_10.jpg).
  • If captured frames are compressed to a .tar package, the .tar package is output with the specified file name.

thumb_samp_format

File format of captured frames.

Supported file format: JPG

thumb_samp_width

Width of captured frames.

Value range: (96, 3840]

Unit: pixel

thumb_samp_height

Height of captured frames.

Value range: (96, 2160]

Unit: pixel

thumb_samp_maxlen

Maximum output width of a captured frame. The width of a captured frame is scaled based on the ratio between its width and the input video pixel.

Value range: [240, 3840]

Unit: pixel

NOTE:

You can use either this parameter or the thumb_samp_width and thumb_samp_height to specify the width and height of a captured frame. thumb_samp_width and thumb_samp_height have higher priority. If either of thumb_samp_width or thumb_samp_height is not 0, the captured frame size is scaled based on these two parameters. Only when these two parameters are both 0, the captured frame size is scaled based on the value of thumb_samp_maxlen.

thumb_samp_ratio

Aspect ratio of a captured frame.

thumb_samp_percent

Percentage of the video duration that frames are captured based on.

thumb_samp_dots

Array of time points when frames are taken.

Array parameters must be enclosed by square brackets ([]). Use commas (,) to separate values.

thumb_samp_time

Interval for capturing frames.

Unit: second

thumb_samp_start

Start time when the sampling type is TIME. This parameter is used together with thumb_samp_time.

Unit: second

thumb_samp_duration

Duration time when the sampling type is TIME. This parameter is used together with thumb_samp_time and thumb_samp_start. This parameter configuration indicates that a frame is captured at an interval specified by thumb_samp_time, starting from the time specified by thumb_samp_start time. The capturing lasts for the period specified by thumb_samp_duration.

Value range: a digit greater than or equal to 0. ToEND indicates that the process lasts until the end of the video.

Unit: second

NOTE:

The value of thumb_samp_duration must be greater than 0. If it is set to 0, frames are captured from thumb_samp_start through the end of the video.

Media Transcoding

This action template is used to execute transcoding tasks in MCP, such as transcoding videos, adding watermarks, checking content quality, and capturing video frames. This action calls the API of MPC for creating a transcoding task.

Table 5 Media transcoding parameters

Type

Parameter Name

Description

Basic Parameters

Action

Action name displayed under the icon in the workflow orchestration area

  • An action name starts with a letter or digit.
  • Only letters, digits, underscores (_), and hyphens (-) are allowed.
  • An action name length is between 1 to 20 characters.
  • Each action name is unique in a workflow.

Timeout (s)

Timeout interval of an action, or the maximum duration of an action

The value ranges from 0 to 300 seconds. If the value is set to 0, it indicates the timeout interval is 30 seconds by default.

Action Provider

Provider of the selected action template

Error Handling

You can specify the number of retry attempts, interval between retry attempts, and the next action if all retry attempts fail.

Error types include: match any, execution failed, invalid permission, invalid parameter, nonexistent function, too many requests, unavailable function, and function exception.

Dynamic Parameters

(Basic Parameters)

trans_output_bucket

The bucket for storing output videos after transcoding.

The output bucket and the Data+ workflow must be in the same region. A Data+ workflow is in the region of the bucket for which the workflow is created. If workflow A is created for bucket A, workflow A is in the region where bucket A is located.

trans_output_path

Directory for storing transcoded videos in the output bucket.

For example, if you enter abc or abc/, the output videos are saved in the abc folder in the output bucket. If the abc folder does not exist, the system automatically creates it. If this parameter is not specified, videos are stored in the root directory of the output bucket.

trans_tid

Transcoding template ID. Each transcoding output corresponds to a transcoding template ID. A maximum of nine template IDs are supported.

Array parameters must be enclosed by square brackets ([]). Use commas (,) to separate values.

Dynamic Parameters

(Subtitle Parameters)

trans_subt_type

Subtitle type of the transcoded media.

trans_subt_bucket

The bucket for storing subtitle files.

trans_subt_object

Object name of the subtitle file, or the subtitle file name.

Dynamic Parameters

(Image Watermark Parameters)

trans_wm_bucket

The bucket for storing image watermarks.

trans_wm_object

Object name of an image watermark, or the watermark file name.

trans_iwm_dx

Horizontal offset between the start point of the watermark and the vertex of the output video.

The value can either be a positive integer or a decimal between 0.0 and 1.0.

  • Integer: horizontal offset between the image start point and the video vertex, in pixels. The value ranges from 0 to 4,096.
  • Decimal: horizontal offset ratio of the image start point relative to the video width. A maximum of four decimal places are supported, for example, 0.9999.

For example, if the output video width is 1920 pixels, dx is 0.1, and referpos is TopRight, the horizontal offset between the upper right corner of the watermark and the right vertex of the video is 192.

trans_iwm_dy

Vertical offset between the start point of the watermark and the vertex of the output video.

The value can either be a positive integer or a decimal between 0.0 and 1.0.

  • Integer: vertical offset between the image start point and the video vertex, in pixels. The value ranges from 0 to 4,096.
  • Decimal: vertical offset ratio of the image start point relative to the video height. A maximum of four decimal places are supported, for example, 0.9999.

For example, if the output video height is 1080 pixels, dy is 0.1, and referpos is TopRight, the vertical offset between the upper right corner of the watermark and the right vertex of the video is 108.

trans_iwm_rpos

Watermark position. Supported watermark positions:

  • Upper right corner
  • Upper left corner
  • Lower right corner
  • Lower left corner

trans_iwm_tstart

The time when a watermark is added. This parameter is used together with trans_iwm_tduration.

Its value is a digit.

Unit: second

trans_iwm_tduration

The time period that a watermark lasts. This parameter is used together with trans_iwm_tstart.

Its value is a digit greater than or equal to 0. ToEND indicates that it lasts until the end of the video.

trans_iwm_iprocess

How an image watermark is processed. The following methods are supported:

  • Scale
  • Gray out
  • Transparent

trans_iwm_width

Watermark width. The value options are as follows:

  • An integer ranging from 8 to 4096, indicating the watermark image width. Unit: pixel.
  • A decimal between 0.0 to 1.0, indicating the ratio of the watermark width to the output video width. A maximum of four decimal places are supported, for example, 0.9999.

trans_iwm_height

Watermark height. The value options are as follows:

  • An integer ranging from 8 to 4096, indicating the watermark image height. Unit: pixel.
  • A decimal between 0.0 to 1.0, indicating the ratio of the watermark height to the output video height. A maximum of four decimal places are supported, for example, 0.9999.

trans_iwm_base

Where a watermark is overlaid. The value options are as follows:

  • Add to the input videos.
  • Add to the transcoded output videos.

Dynamic Parameters

(Watermark Parameters)

trans_wm_tid

ID of a watermark template You can create a watermark template by calling the API for creating a watermark template.

Dynamic Parameters

(Text Watermark Parameters)

trans_wm_text

Text watermark content, which must be Base64 encoded. This parameter needs to be specified.

For example, if you want to add the text watermark test text watermark, the value is 5rWL6K+V5paH5a2X5rC05Y2w.

trans_twm_dx

Horizontal offset between the start point of the text watermark and the vertex of the output video.

The value can either be a positive integer or a decimal between 0.0 and 1.0.

  • Integer: horizontal offset between the text start point and the video vertex, in pixels. The value ranges from 0 to 4,096.
  • Decimal: horizontal offset ratio of the text start point relative to the video width. A maximum of four decimal places are supported, for example, 0.9999.

For example, if the output video width is 1920 pixels, dx is 0.1, and referpos is TopRight, the horizontal offset between the upper right corner of the watermark and the right vertex of the video is 192.

trans_twm_dy

Vertical offset between the start point of the text watermark and the vertex of the output video.

The value can either be a positive integer or a decimal between 0.0 and 1.0.

  • Integer: vertical offset between the text start point and the video vertex, in pixels. The value ranges from 0 to 4,096.
  • Decimal: vertical offset ratio of the text start point relative to the video height. A maximum of four decimal places are supported, for example, 0.9999.

For example, if the output video height is 1080 pixels, dy is 0.1, and referpos is TopRight, the vertical offset between the upper right corner of the watermark and the right vertex of the video is 108.

trans_twm_rpos

Text watermark position. Supported watermark positions:

  • Upper right corner
  • Upper left corner
  • Lower right corner
  • Lower left corner

trans_twm_tstart

The time when a watermark is added. This parameter is used together with trans_twm_tduration.

Its value is a digit.

Unit: second

trans_twm_tduration

The time period that a watermark lasts. This parameter is used together with trans_twm_tstart.

Its value is a digit greater than or equal to 0. ToEND indicates that it lasts until the end of the video.

trans_twm_base

Where a watermark is overlaid. The value options are as follows:

  • Add to the input videos.
  • Add to the transcoded output videos.

trans_twm_fname

Font of the watermark text. The following fonts are supported:

  • fzyouh
  • msyh

trans_twm_fsize

Font size of the watermark text.

The value ranges from 4 to 120.

trans_twm_fcolor

Watermark text color.

DIS Message Notification

The template sends messages to the specified DIS stream. This template invokes the data upload API of Data Ingestion Service (DIS).

Table 6 DIS message notification parameters

Type

Parameter Name

Description

Basic Parameters

Action

Action name displayed under the icon in the workflow orchestration area

  • An action name starts with a letter or digit.
  • Only letters, digits, underscores (_), and hyphens (-) are allowed.
  • An action name length is between 1 to 20 characters.
  • Each action name is unique in a workflow.

Timeout (s)

Timeout interval of an action, or the maximum duration of an action

The value ranges from 0 to 300 seconds. If the value is set to 0, it indicates the timeout interval is 30 seconds by default.

Action Provider

Provider of the selected action template

Error Handling

You can specify the number of retry attempts, interval between retry attempts, and the next action if all retry attempts fail.

Error types include: match any, execution failed, invalid permission, invalid parameter, nonexistent function, too many requests, unavailable function, and function exception.

Dynamic Parameters

stream_name

DIS stream name

partition_id

DIS partition ID

partition_key

DIS partition where data is written

SMN Message Notice

This template is used to send notifications to SMN topic subscribers after a task is executed. You can add this action at any position of the workflow to send the execution result of a previous function to the subscribers.

Table 7 SMN message notice parameters

Type

Parameter Name

Description

Basic Parameters

Action

Action name displayed under the icon in the workflow orchestration area

  • An action name starts with a letter or digit.
  • Only letters, digits, underscores (_), and hyphens (-) are allowed.
  • An action name length is between 1 to 20 characters.
  • Each action name is unique in a workflow.

Timeout (s)

Timeout interval of an action, or the maximum duration of an action

The value ranges from 0 to 300 seconds. If the value is set to 0, it indicates the timeout interval is 30 seconds by default.

Action Provider

Provider of the selected action template

Error Handling

You can specify the number of retry attempts, interval between retry attempts, and the next action if all retry attempts fail.

Error types include: match any, execution failed, invalid permission, invalid parameter, nonexistent function, too many requests, unavailable function, and function exception.

Dynamic Parameters

topic_urn

SMN topic ID Select an SMN topic authorized by OBS to send messages to subscribers. You can create such topics on the SMN management console.

For details, see sections of Creating a Topic, Configuring Topic Policies, and Adding a Subscription in the Simple Message Notification User Guide.

NOTE:

After the SMN topic is configured, do not delete the topic associated with Data+ workflows or cancel the OBS authorization of the topic. If the topic is deleted or its OBS authorization is canceled, subscribers of the topic may fail to receive messages.

Only SMN topics in the same region and project of the workflow are displayed in the drop-down list. By default, a bucket and its workflows are in the same region. If workflow A is created for bucket A, workflow A is in the region where bucket A is located.

topic_subject

Name of the SMN topic, which is used as the subject of an email sent to subscribers.

Video Content Moderation

This template checks whether the video content is compliant and whether illegal content is involved. This template invokes the job creating API of Video Analysis Service (VAS).

Table 8 Video content moderation parameters

Type

Parameter Name

Description

Basic Parameters

Action

Action name displayed under the icon in the workflow orchestration area

  • An action name starts with a letter or digit.
  • Only letters, digits, underscores (_), and hyphens (-) are allowed.
  • An action name length is between 1 to 20 characters.
  • Each action name is unique in a workflow.

Timeout (s)

Timeout interval of an action, or the maximum duration of an action

The value ranges from 0 to 300 seconds. If the value is set to 0, it indicates the timeout interval is 30 seconds by default.

Action Provider

Provider of the selected action template

Error Handling

You can specify the number of retry attempts, interval between retry attempts, and the next action if all retry attempts fail.

Error types include: match any, execution failed, invalid permission, invalid parameter, nonexistent function, too many requests, unavailable function, and function exception.

Dynamic Parameters

task_name

Job name

description

Job description

modeout_bucket

Name of the OBS bucket where output results are stored.

The output bucket and the Data+ workflow must be in the same region. A Data+ workflow is in the region of the bucket for which the workflow is created. If workflow A is created for bucket A, workflow A is in the region where bucket A is located.

modeout_path

Path in the OBS bucket where output results are stored.

For example, if you enter abc or abc/, the output results are saved in the abc folder in the output bucket. If the abc folder does not exist, the system automatically creates it. If this parameter is not specified, output files are stored in the root directory of the output bucket.

frame_interval

Frame capturing interval. Unit: seconds per frame.

categories

Video content moderation categories:

  • Political figures
  • Terrorist element
  • Pornographic content

text_categories

Audio and text content moderation categories:

  • Political figures
  • Terrorist element
  • Pornographic content
  • Offensive content
  • Contraband content

use_sis

Indicates whether to enable audio content moderation.

use_ocr

Indicates whether to enable text content moderation.

modera_upload

Indicates whether to upload the detected problematic images to the cloud.

service_version

Service version. Supported version: 1.2

Event Delay

This action template is used to control the time between two adjacent actions in a workflow. Specifically, at what time is action B executed after action A finishes.

Table 9 Event delay parameters

Type

Parameter Name

Description

Basic Parameters

Action

Action name displayed under the icon in the workflow orchestration area.

  • An action name starts with a letter or digit.
  • Only letters, digits, underscores (_), and hyphens (-) are allowed.
  • An action name length is between 1 to 20 characters.
  • Each action name is unique in a workflow.

Timeout (s)

Waiting duration before the next action is executed, in seconds. The value ranges from 1 to 86400 seconds.

Custom Functions

You can customize functions to meet actual needs in different scenarios.

The following table describes the custom template parameters. You also need to follow Development Specifications on Custom Functions.

Table 10 Custom template parameters

Type

Parameter Name

Description

Basic Parameters

Action

Action name displayed under the icon in the workflow orchestration area

  • An action name starts with a letter or digit.
  • Only letters, digits, underscores (_), and hyphens (-) are allowed.
  • An action name length is between 1 to 20 characters.
  • Each action name is unique in a workflow.

Timeout (s)

Timeout interval of an action, or the maximum duration of an action

The value ranges from 0 to 300 seconds. If the value is set to 0, it indicates the timeout interval is 30 seconds by default.

Unique ID of a function.

Select the function to be executed from FunctionGraph. Functions can be created on the FunctionGraph console.

For details, see Creating and Initializing a Function in the FunctionGraph User Guide.

Only functions in the same region and project of the workflow are displayed in the drop-down list. By default, a bucket and its workflows are in the same region. If workflow A is created for bucket A, workflow A is in the region where bucket A is located.

Dynamic Parameters

If a custom function contains dynamic parameters, you can specify the names and values of the dynamic parameters as the input of the function.