A workflow refers to a sequential set of job tasks performed on a source audio/video file. Jobs tasks can be parallel or serial and are generally referred to as tasks in MPS. A workflow is as shown below.
An MPS workflow consists of tasks such as transcoding, sampled screencapturing, time point screencapturing, animated image generating, image sprite generating, and watermarking. Below is an example of a typical MPS workflow:
If a transcoding task contains several varying specifications, such as transcoding to SD and HD and generating screenshots of different sizes, it will be broken down into multiple subtasks that will be executed simultaneously. When all subtasks are completed, MPS will integrate the results and end the task.
Taking video processing as an example, a workflow mainly consists of operations such as configuring a workflow, triggering transcoding, performing a transcoding task, and sending notifications, as shown below.
For transcoding task to be triggered automatically upon file upload, the workflow needs to be configured in advance. The workflow will automatically initiate the specified transcoding task for files uploaded to the specified COS bucket and upload the output files to the same or another COS bucket.
If you do not want to automatically trigger a transcoding task upon file upload, you can call an API to manually trigger a transcoding task for a single file. In this case, you do not need to configure a workflow.
A transcoding task can be automatically or manually triggered.
Automatic triggering: With a configured workflow, a transcoding task will be automatically triggered upon file upload.
Manual triggering: You can call an API to initiate a transcoding task and receive task completion notifications through CMQ or query the task status through
TaskId. For more information on manual triggering, please see Manually Initiating Transcoding.
- Step 5 in the above figure indicates that you can call an API to query the task status with the
TaskIdparameter returned by task initiation.
- Steps in the red box are optional. When you manually trigger a transcoding task, you can use CMQ to receive notifications or query the task status through an API as shown in step 5.
A transcoding task includes operations such as transcoding, screencapturing, and watermarking as well as output file uploading. A task will be broken down into several subtasks for parallel or serial processing to speed up the processing.
After the task is completed, MPS will upload the output files to the specified COS bucket. If upload fails, the final task status will be "failed".
No matter whether a transcoding task succeeded or failed, you will receive a notification when it is completed. You can proceed on to the next step upon receiving the notification.