After a video processing task is initiated, it takes a few minutes to a few hours for the task to complete execution and output the result. Video processing is essentially an offline task. Taking into account the characteristics of video processing tasks, VOD provides a task system allowing you to initiate tasks synchronously and receive task execution result notifications asynchronously.
Video processing parameters are usually quite complicated. For example, video transcoding involves dozens of parameters such as container format, codec, bitrate, resolution, and frame rate. In order to simplify the parameters of video processing tasks, VOD offers a variety of integrated parameter templates (e.g., transcoding templates), which are identified by template ID.
In VOD, the following video processing operations are independent tasks:
If several independent tasks are executed at the same time, there will be multiple task IDs, and you will have to receive and deal with multiple task result notifications. In order to simply the initiation and notification of multiple tasks, VOD offers a task flow scheme. A task flow is essentially a "parent task" composed of multiple subtasks. Initiating a task flow is equivalent to initiating all the subtasks.
As shown in the figure, the task flow contains three subtasks and ends when the last subtask (subtask 3) is completed. Task flow result notification will be triggered when the task flow ends as well as when each of the subtasks is completed, enabling you to perceive the execution result of any subtask in real time.
Most video processing tasks in VOD are performed in the form of a task flow, which can be regarded as a special type of task. VOD also supports creating task flow templates and naming them. When initiating a task flow, you can use the task flow template name to indicate the desired task.
There are three ways to initiate a video processing task, namely, initiating through server API, initiating through the console, and specifying a task upon upload.
Through server APIs, you can directly initiate a task for a video in VOD or edit it and specify the tasks to be executed for the generated new video.
You can initiate a task for a video in VOD through the console. For more information, please see Processing Videos.
VOD offers three ways to upload a video: upload from client, upload from server, and upload through the console. All of them support specifying the task to be executed upon upload.
procedureparameter in the signature for upload from client.
procedureparameter in the ApplyUpload API.
After initiating a video processing task, you need to perceive the task execution result asynchronously through "result notification".
Video processing result notifications mainly include the following types:
Video processing result notifications are a type of "event notifications" in VOD, which can be received in two modes: "HTTP normal callback" and "reliable callback". For more information, please see Event Notification.
In addition to perceiving the task execution result through result notifications, you can poll task execution status by task ID as scheduled, which is called "task query". Currently, VOD only provides the DescribeTasks and DescribeTaskDetail server APIs for querying task execution status and execution result.