All Products
Search
Document Center

ApsaraVideo VOD:Workflows

Last Updated:Sep 05, 2024

ApsaraVideo VOD provides a variety of media processing capabilities, such as transcoding, snapshot capture, and automated review. To make media processing capabilities easier to use, ApsaraVideo VOD provides workflow capabilities that allow you to customize media processing workflows in the console. This topic describes the architecture, configuration, and usage of workflows.

Overview

Workflows are designed to streamline and instantiate most media processing features. You can customize workflows in advance to process videos in a one-stop manner instead of repeatedly calling API operations. Workflows allow you to specify the conditions that must be met to trigger the next node and automatically determine whether the conditions are met. This facilitates flexible scenario-based media processing.

Scenarios

  • "Review + Transcoding" serial workflow

    This workflow indicates a serial process where videos you upload are reviewed and then transcoded. For more information, see the Sample configurations section.

  • "Review + Transcoding" parallel workflow

    This workflow indicates a process where videos you upload are reviewed and transcoded in parallel.

  • "Source file distribution + Transcoding" parallel workflow

    This workflow indicates a process where the source video file you upload is distributed while it is being transcoded based on the transcoding nodes you configure.

Workflow process

Preparation: Configure a workflow in the console.

  1. A user obtains an upload credential and specifies the workflow. ApsaraVideo VOD returns the upload credential.

  2. The user initiates video upload.

  3. After videos are uploaded, the workflow is triggered.

  4. The workflow engine of ApsaraVideo VOD automatically performs media processing and video AI operations based on the workflow configuration.

Procedure

  1. Create a workflow.

    You can create a workflow only in the ApsaraVideo VOD console.

    View the steps

    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. On the Add Workflow page, enter a workflow name.

    4. Click the + icon next to Start, specify the topology of the workflow, and then click Confirm.工作流1

    5. After the workflow is created, you can obtain the workflow ID on the Workflows page. The ID is required when you submit processing tasks based on the workflow.

  2. Submit a processing task based on the workflow.

    You can use the workflow to submit a processing task for uploaded videos or during uploads.

    Submit a processing task in the ApsaraVideo VOD console

    Submit a processing task during uploads

    1. Log on to the ApsaraVideo VOD console.

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

    3. On the Upload Media page, click Add Media. In the dialog box that appears, specify the storage address, select Use Workflow from the drop-down list, and specify the workflow that you created in the preceding step.

      For more information about supported video formats and parameter descriptions, see Upload media files by using the ApsaraVideo VOD console.工作流3

    4. Select the media files that you want to upload and click Upload.

    Submit a processing task for uploaded files

    1. Log on to the ApsaraVideo VOD console.

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

    3. On the Audio/Video page, find the audio or video file that you want to manage and click Media Processing in the Actions column.

    4. In the dialog box that appears, select Use Workflow and select the workflow that you created in the preceding step from the drop-down list.工作流2

    5. Click OK.

    Submit a processing task by using the ApsaraVideo VOD API

    Submit a processing task during uploads

    Note

    You can call the CreateUploadVideo operation only to obtain the upload URLs and credentials for media files and create media assets in ApsaraVideo VOD. You cannot call this operation to upload media files. You must implement the logic for the entire upload process. For more information about how to upload media files by calling API operations, see Upload media files by calling API operations.

    1. Call the CreateUploadVideo or UploadMediaByURL operation to upload audio and video files and set the WorkflowId parameter to the ID of the workflow that you created in the preceding step. After the audio and video files are uploaded, ApsaraVideo VOD automatically processes the files based on the specified workflow.

    Submit a processing task for uploaded files

    1. Call the SubmitWorkflowJob operation and set the WorkflowId parameter to the ID of the workflow that you created in the preceding step. Then, ApsaraVideo VOD automatically processes the files based on the specified workflow.

Sample configurations

"Review + Transcoding" serial workflow

The "Review + Transcoding" serial workflow is used in the following example to show the configuration of a workflow. The workflow indicates that an uploaded video is reviewed first, and then transcoded if it passes the review.

  1. In the Workflow Topology section, click the + icon next to Start and add a node. A review node is added as an example.添加节点

  2. After the node is added, click the Edit icon on the Review node. In the dialog box that appears, select a review template and click OK.添加审核模板

  3. Click the + icon next to Review and add a Transcode node after the Review node.

  4. After the node is added, click the Edit icon next to Transcode. In the dialog box that appears, configure the trigger condition.

    Important

    The Performs Conditional parameter specifies the condition that the parent node must meet to trigger the current node. You can specify a trigger condition based on your business requirements.

    In this example, videos must pass the review before they can be transcoded. In this case, set Performs Conditional to Parent Node Approval Passed and select a transcoding template group from the Transcoding Template Group drop-down list. 父节点审核通过

    The following table describes all conditions.

    Scenario

    Condition

    Description

    The parent node is a Review node.

    All Conditions

    The current node can be executed under all conditions.

    Parent Node Approval Passed

    The node is executed only if the video passes the review.

    Parent Node Audit Processing Failed

    The node is executed only if the video source file fails the review. Select this condition if you are aware that the source video file is damaged.

    Parent Node Video Violation Blocking

    The node is executed only if the video fails the review and is blocked due to a violation. Select this condition if you want to transcode the blocked video into one with lower definition for manual review.

    The parent node is a Transcode node.

    All Conditions

    The current node can be executed under all conditions.

    Parent Node Transcoding Succeeded

    The node is executed only if the video transcoding is complete.

    Parent Node Transcoding Failed

    The node is executed only if the video transcoding fails.

  5. After you configure the workflow topology, click Confirm. The system automatically generates a workflow ID. Save the ID for subsequent use.完成

"Review + Transcoding" parallel workflow

To create a workflow that implements review and transcoding in parallel, you can click the + icon next to Start and select Review to create a Review node. Then, click the + icon next to Start again and select Transcode to create a Transcode node.

Important

After the nodes are created, click the Edit icons next to the two nodes and select templates as described in the preceding example.