All Products
Search
Document Center

ApsaraVideo Media Processing:Workflow activities

Last Updated:Oct 15, 2024

This topic describes the activities and supported parameters in the topology of a media workflow. If you want to configure the topology of a media workflow by calling the AddMediaWorkflow or UpdateMediaWorkflow operation, you can refer to this topic.

Activities

Activity name

Activity type in the topology

Description

Input

Start

Required. Configures the Object Storage Service (OSS) input path and global settings including the ApsaraVideo Media Processing (MPS) queue and message notifications.

Publish

Report

Required. Configures the publishing mode. Two publishing modes are supported: Auto and Manual.

Analyze

Analysis

Intelligently analyzes input media files and recommends appropriate preset templates for the files.

Encode

Transcode

Transcodes input media files to different formats. This ensures that the files can be played on different platforms.

Snapshot

Screenshot

Captures the snapshots of videos at specific points in time. You can use a snapshot as the video thumbnail or use multiple snapshots to generate a sprite.

Pack

PackageConfig

Packages multi-resolution, multi-audio track, and multi-subtitle video files to generate M3U8 files.

Video Group

VideoGroup

Audio Group

AudioGroup

Subtitle Group

SubtitleGroup

Extract Video

Extract Audio

Extract Subtitle

Transcode

Generate

GenerateMasterPlayList

Content Moderation

Censor

Detects pornographic content, terrorist content, and undesirable content in speeches, text, and scenes of a video. This reduces costs for manual review and lowers the risks that may be brought by non-compliant content.

Video DNA

FpShot

Uniquely identifies a video. This allows you to extract and compare the fingerprints of images and audio in videos. This way, you can find duplicate videos, trace the source of video clips, and identify plagiarism.

Intelligent Thumbnail

Cover

Selects the optimum key frame or clip of a video as the video thumbnail to improve the clicks conversion rate and user experience of the video. This is implemented by using algorithms based on a full understanding of the video content, image aesthetics, and large amounts of user behavior data.

Input

This activity is required. You can configure the OSS input path and global settings including the MPS queue and message notifications for a media workflow.

This activity obtains media information. If the media information fails to be obtained, the subsequent activities are skipped until the Publish activity is run.

Parameter

Type

Required

Description

InputFile

String

Yes

The input file. You can use the Bucket, Location, and Object parameters to specify the location of the file.

  • For more information about workflow triggering rules, see Workflow triggering rules for files.

  • The file can be stored only in OSS. For more information about the details of the InputFile parameter, see Parameter details.

  • The path of an OSS object must be URL-encoded in UTF-8 before you use the path in MPS. For more information, see URL encoding.

  • Example: {"Bucket":"example-bucket","Location":"oss-cn-hangzhou","ObjectPrefix":"example.mp4"}.

PipelineId

String

Yes

The ID of the MPS queue, which is a global setting.

  • This MPS queue ID is used only for the Analyze, Encode, Snapshot, and Pack activities. For AI jobs, you must separately configure the MPS queue ID for an activity.

  • In a media workflow, the message settings for a specific MPS queue are invalid. Use the setting of the QueueName or TopicName parameter for the media workflow instead.

MessageType

String

No

The type of the message, which is a global setting. Valid values:

  • Queue: Simple Message Queue (formerly MNS) queue. If you set this parameter to Queue, you must specify the QueueName parameter.

  • Topic: SMQ topic. If you set this parameter to Topic, you must specify the TopicName parameter.

  • Default value: Queue.

QueueName

String

No

The SMQ queue to be associated with the MPS queue, which is a global setting. After a job is complete in the MPS queue, the job results are pushed to the SMQ queue. For more information about message notifications, see Receive notifications.

  • You can specify one of the SMQ queues that you have created. If no SMQ queue is available, create one in the SMQ console.

TopicName

String

No

The SMQ topic to be associated with the MPS queue, which is a global setting. After a job is complete in the MPS queue, the job results are pushed to the SMQ topic. The associated SMQ topic pushes a message about the results to the URL that subscribes to the SMQ topic. For more information, see Receive notifications.

  • You can specify one of the SMQ topics that you have created. If no SMQ topic is available, create one in the SMQ console.

RoleName

String

No

The name of the Resource Access Management (RAM) role, which is a global setting.

  • Default value: AliyunMTSDefaultRole.

Publish

This activity is required. You can configure the media publishing mode after the workflow is run.

Parameter

Type

Required

Description

PublishType

String

No

The publishing mode of the media file, which is a global setting. Valid values:

  • Manual: manually publishes the media file. The media file is unpublished after the workflow is run. You can manually publish the media file. For more information, see Manage media files.

  • Auto: automatically publishes the media file after all activities are complete. The media file is automatically published after the workflow is run.

  • TranscodeCompletedAuto: automatically publishes the media file after a Transcode activity is complete. The message settings of the Input activity are used to notify you that transcoding is complete. If the Transcode activity is skipped, no message is sent.

  • Default value: Manual.

    Note
    • MPS processes media files in a workflow and uses Security Token Service (STS) to grant permissions to RAM users. This allows you to configure how media files are published.

    • The publishing state affects the access permissions on the output file.

      • If the output video, audio, and snapshot files are not published, the access permissions on the files are private.

      • If the output video, audio, and snapshot files are published, the access permissions on the files are determined based on the access permissions on the OSS bucket in which they reside.

Analyze

This activity intelligently analyzes input media files and recommends appropriate preset templates for the files.

Parameter

Type

Required

Description

KeepOnlyHighestDefinition

String

No

Specifies whether to retain only the analysis results for videos in the highest definition. Valid values:

  • True: retains only the output video in the highest definition.

  • False: generates the output videos in all definitions.

  • Default value: False.

Encode

Parameter

Type

Required

Description

Outputs

String

No

The outputs of the transcoding jobs.

  • Specify the value in a JSON array of Output objects. You can specify up to 30 Output objects.

  • For more information about the parameters in each Output object, see Parameter details.

  • Example: [{"OutputObject":"transcode%2F%7BObjectPrefix%7D%2F%7BFileName%7D.%7BExtName%7D","TemplateId": "S00000001-000070"}].

OutputBucket

String

No

The name of the output bucket.

  • During HTTP Live Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH) packaging, the Bucket parameter in the Pack activity takes precedence over the OutputBucket parameter.

OutputLocation

String

No

The region of the output bucket.

  • During HLS and DASH packaging, the Location parameter in the Pack activity takes precedence over the OutputLocation parameter.

MultiBitrateVideoStream

String

No

This parameter is required for extracting video streams during HLS packaging.

ExtXMedia

String

No

This parameter is required for extracting audio or subtitle streams during HLS packaging.

  • For more information, see Parameter details.

  • Example: {"Name": "english","Language": "en-US","URI":"c/d/audio-1.m3u8"}.

WebVTTSubtitleURL

String

No

The subtitle URL. This parameter is required for extracting subtitle streams during HLS packaging.

  • Only Web Video Text Tracks (WebVTT) subtitle files are supported. The subtitle URL must comply with the URL standard and can be overwritten when you call the AddMedia operation.

  • Example: http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com/subtitles****-en.vtt.

Representation

String

No

This parameter is required for extracting video, audio, or subtitle streams during DASH packaging.

  • For more information, see Parameter details.

  • Example: {\"Id\":\"480p\", \"URI\":\"videoSD/xx.mpd\"}.

InputConfig

String

No

The subtitle URL. This parameter is required for extracting subtitle streams during DASH packaging.

  • For more information, see Parameter details.

  • Example: "{\"Format\":\"vtt\",\"InputFile\":{\"URL\":\"http://example-Bucket-****.oss-cn-hangzhou.aliyuncs.com/subtitle/subtitle****-en.vtt\"}}".

Snapshot

Parameter

Type

Required

Description

SnapshotConfig

String

Yes

The snapshot configurations.

  • For more information, see Parameter details.

  • Example: {"OutputFile": {"Bucket": "example-001", "Location": "oss-cn-hangzhou", "Object":"snapshot%2F%7BObjectPrefix%7D%2F%7BFileName%7D.%7BExtName%7D%2F1.jpg"},"Time": "5"}.

MediaCover

String

No

Specifies whether to set the snapshot as the media thumbnail. This parameter is valid only for a single snapshot. Valid values:

  • true

  • false

  • Default value: false.

Pack

Pack

Parameter

Type

Required

Description

Output

String

Yes

The detailed information about the output file, which is a JSON string. Example: {"Bucket":"output","Location":"oss-cn-hangzhou","MasterPlayListName":"a/b/c.m3u8"}.

Note

Placeholders that can be used to specify the MasterPlayListName parameter:

  • {ObjectPrefix}: the original file path that does not include the bucket information.

  • {FileName}: the original file name that contains the file name extension. The file name extension varies based on the format of the transcoding template.

  • {ExtName}: the file name extension of the original file.

  • {RunId}: the ID of the workflow instance.

  • {MediaId}: the ID of the media file that is processed in the workflow.

Protocol

String

Yes

The protocol that can be used for packaging. Valid values: hls and dash.

Video Group

Parameter

Type

Required

Description

AdaptationSet

String

No

The information about the video group. This parameter is required for DASH packaging.

  • For more information, see Parameter details.

  • Example: "AdaptationSet":"{\"Group\":\"VideoGroup\"}".

Audio Group

Parameter

Type

Required

Description

GroupId

String

No

The ID of the audio group. This parameter is required for HLS packaging.

  • The ID can be up to 32 bytes in length.

AdaptationSet

String

No

The information about the audio group. This parameter is required for DASH packaging.

  • For more information, see Parameter details.

  • Example: "{\"Lang\":\"english\", \"Group\":\"AudioGroupEnglish\"}".

Subtitle Group

Parameter

Type

Required

Description

GroupId

String

No

The ID of the subtitle group. This parameter is required for HLS packaging.

  • The ID can be up to 32 bytes in length.

AdaptationSet

String

No

The information about the subtitle group. This parameter is required for DASH packaging.

  • For more information, see Parameter details.

  • Example: "{\"Lang\":\"english\", \"Group\":\"SubtitleENGroup\"}".

Generate

Parameter

Type

Required

Description

MasterPlayList

String

No

  • The multi-bitrate video streams. This parameter is exclusive and required for HLS packaging. For more information, see Parameter details.

  • Example: {"MultiBitrateVideoStreams": [{"RefActivityName": "video-1","ExtXStreamInf": {"BandWidth": "111110","Audio": "auds","Subtitles": "subs"}}]}.

References