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.
A user obtains an upload credential and specifies the workflow. ApsaraVideo VOD returns the upload credential.
The user initiates video upload.
After videos are uploaded, the workflow is triggered.
The workflow engine of ApsaraVideo VOD automatically performs media processing and video AI operations based on the workflow configuration.
Procedure
Create a workflow.
You can create a workflow only in the ApsaraVideo VOD console.
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
Log on to the ApsaraVideo VOD console.
In the left-side navigation pane, choose Media Files > Audio/Video. Then, click Upload.
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.
Select the media files that you want to upload and click Upload.
Submit a processing task for uploaded files
Log on to the ApsaraVideo VOD console.
In the left-side navigation pane, choose Media Files > Audio/Video.
On the Audio/Video page, find the audio or video file that you want to manage and click Media Processing in the Actions column.
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.
Click OK.
Submit a processing task by using the ApsaraVideo VOD API
Submit a processing task during uploads
NoteYou 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.
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
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.
In the Workflow Topology section, click the + icon next to Start and add a node. A review node is added as an example.
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.
Click the + icon next to Review and add a Transcode node after the Review node.
After the node is added, click the Edit icon next to Transcode. In the dialog box that appears, configure the trigger condition.
ImportantThe 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.
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.
After the nodes are created, click the Edit icons next to the two nodes and select templates as described in the preceding example.