Workflows 2.0

更新时间:
复制 MD 格式

ApsaraVideo VOD provides a suite of media processing features, such as transcoding, video snapshots, and automated review. To simplify media processing, ApsaraVideo VOD offers workflows that allow you to create custom processing pipelines in the console. This topic describes how to use workflows.

What is a workflow

A workflow streamlines and modularizes media processing tasks. You can pre-configure a custom processing pipeline and apply it to your videos. This approach eliminates the need for repetitive and complex API calls and provides a unified media processing service.

What's new

The new version of workflows not only includes nodes for core ApsaraVideo VOD features but also adds nodes from Intelligent Media Services (IMS) for video translation, subtitle extraction, subtitle removal, and logo removal. This update also introduces support for task queries and workflow task callbacks. We will add more feature nodes to meet evolving business needs.

Feature comparison

✔️ indicates that a feature is supported, ❌ indicates that it is not, and — indicates that the feature is not applicable.

Category

Feature

Previous version

New version

ApsaraVideo VOD nodes

video transcoding

✔️

✔️

video snapshot

✔️

✔️

video animation

✔️

✔️

automated review/deduplication

✔️

Intelligent Media Services nodes

video translation

✔️

subtitle extraction

✔️

subtitle removal

✔️

logo removal

✔️

Workflow task query

✔️

workflow callback

Workflow task callback events

✔️

Individual workflow callback settings

✔️

Individual node task callback

✔️

Media ID-level callback (userdata)

✔️

Limitations

  • The video translation, subtitle extraction, and subtitle removal nodes are available only in the China (Shanghai), China (Beijing), China (Shenzhen), and Singapore regions. The logo removal node is available only in the China (Shanghai), China (Beijing), and Singapore regions. ApsaraVideo VOD nodes are available in all regions.

  • To use ApsaraVideo VOD capability nodes, you must activate ApsaraVideo VOD. To use Intelligent Media Services capability nodes, you must activate Intelligent Media Services and subscribe to the Standard edition. For more information, see Subscription.

Use cases

  • Serial: Translation and transcoding

    This workflow first translates a video and then transcodes the translated output. For configuration details, see the Workflow configuration example section. The node configuration for this workflow is: Startvideo translationvideo transcodingEnd. Video data is passed between the nodes.

  • Parallel: Subtitle removal and transcoding

    This workflow performs subtitle removal and transcoding at the same time. The workflow branches from the Start node into two parallel paths: subtitle removal and video transcoding. After the tasks are complete, both paths merge at the End node.

  • Parallel: Source file distribution and transcoding

    This workflow distributes the source file as one playback stream while simultaneously transcoding it to create other renditions based on a specified transcoding template.

    This workflow uses two video transcoding nodes. The upper node must be configured with a no-transcoding template group ID to distribute the source file. The lower node must be configured with a transcoding template group ID to output other renditions.

How it works

Before you begin, you must configure a workflow in the console.

  1. Specify the workflow ID when requesting an upload URL and credentials. ApsaraVideo VOD returns the URL and credentials.

  2. Upload the video.

  3. The workflow is automatically triggered after the upload is complete.

  4. The ApsaraVideo VOD workflow engine automatically performs media processing and video AI tasks according to the workflow configuration.

  5. When all tasks are finished, the workflow ends, and the service sends a callback notification.

How to use

  1. Create a workflow.

    Currently, you can create workflows only in the ApsaraVideo VOD console.

    View Procedure

    1. Log on to the ApsaraVideo VOD console.

    2. In the left-side navigation pane, choose Configuration Management > Media Processing > Workflows.

    3. Click Add Workflow Template and enter a workflow name.

    4. Click the + icon next to the Start node to edit the workflow topology, and then click OK. In the Workflow Template area, click a Video node in the flowchart to configure its settings. As needed, enter a Template Description and select a Callback Event option (Use unified callback configuration or Use independent callback configuration). Click Submit.

    5. After the workflow is created, you can find its ID on the Workflows page. You will need this ID to initiate workflow tasks.

  2. Initiate a workflow task.

    You can initiate a workflow task either during or after video upload.

    In the console

    During upload

    1. Log on to the ApsaraVideo VOD console.

    2. In the left-side navigation pane, choose Media Files > Audio/Video, and then click Upload Audio/Video.

    3. Click Add Audio/Video, configure parameters such as the upload method and bucket, select Use Workflow and then select your workflow.

      For more information about supported upload formats and parameter descriptions, see Upload files in the console.

    4. After adding the media files to be uploaded, click Upload.

    After upload

    1. Log on to the ApsaraVideo VOD console.

    2. In the left-side navigation pane, choose Media Files > Audio/Video.

    3. In the audio/video list, find the media file you want to process and click Processing in the Actions column.

    4. In the Media Processing dialog box, select Use Workflow as the processing type. In the Use Workflow drop-down list, select your target workflow, such as test.

    5. Click OK.

    Using API

    During upload

    Note

    The CreateUploadVideo operation only returns an upload URL, credentials, and basic media asset information. It does not upload the media file. You must implement the upload logic. For a complete example of how to upload files by using the API, see Upload media files by calling the ApsaraVideo VOD API.

    1. When you call the CreateUploadVideo or UploadMediaByURL operation to upload a media file, set the WorkflowId parameter to your workflow's ID. After the upload is complete, the system automatically processes the file based on the specified workflow.

    After upload

    1. To process a media file that has already been uploaded, call the SubmitWorkflowJob operation. Set the WorkflowId parameter to your workflow ID to immediately start the processing task.

Configuration examples

Serial translation and transcoding

This example shows how to configure a serial workflow that first translates a video and then transcodes it.

  1. On the workflow editing page, click the + icon to the right of the Start node to add a video translation node. Configure its parameters in the panel that appears on the right.

  2. Click the + icon to the right of the translation node to add a video transcoding node. In the right-side panel, select a transcoding template group.

    Note

    For information about how to configure a transcoding template group, see Transcoding templates.

  3. After you finish configuring the workflow topology, click OK. The system generates a workflow ID. Save this ID to apply the workflow to future uploads. After you create the workflow, you can view it in the workflow list with its name, ID, and creation time. In the Actions column, click Details to view the workflow configuration or click Delete to remove it.

Parallel subtitle extraction and transcoding

To run subtitle extraction and transcoding in parallel, add two child nodes—subtitle extraction and video transcoding—after the Start node. In the workflow editor, the Start node branches into two parallel paths connected by Video lines. The top path contains the subtitle extraction node (VodCaptionExtraction), and the bottom path contains the video transcoding node (VodTranscode). The two paths then converge at the End node, connected by Subtitle and Video lines respectively.