A workflow refers to a set of job tasks performed on a source audio/video file. Job tasks can be parallel or serial and are simply referred to as tasks in MPS. A workflow is as shown below.
|Circle||Start and end of a task|
|Dot||Assembly or combination of task units|
|Arrow||Order of executing different tasks or different steps of a task|
An MPS workflow may consist of tasks such as transcoding, sampled screenshot, time point screenshot, animated image generating, image sprite generating, and watermarking. Below is a typical example of an MPS workflow:
If a task involves multiple outputs, such as transcoding to SD and HD or taking screenshots of different sizes, it will be broken down into multiple subtasks that will be executed simultaneously. After all subtasks are completed, MPS will combine the results, and the task ends.
The process of executing a workflow involves workflow configuration, task triggering, task execution, and event notification sending, as shown below:
You need to configure a workflow if you want a task to be triggered automatically upon file upload. After configuration, the task will be initiated automatically on files uploaded to the specified COS bucket and the output files will be uploaded to the same or a different COS bucket.
You can also call an API to initiate a task on a specific file, in which case workflow configuration is not required.
A transcoding task can be automatically or manually triggered.
TaskId. For details, see Manually Initiating Transcoding.
- Step 5 is the query of the task status via an API. The request parameter is the
TaskIdreturned after 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.
Task execution may involve transcoding, screenshot taking, watermarking, and output file upload. A task is broken down into several subtasks, which are executed in parallel or in series to speed up the process.
After the task is completed, MPS will upload the output files to the specified COS bucket. If upload fails, the task status will be "failed".
You will be notified when a task is completed, whether it succeeds or fails. You can determine what to do next depending on the notification.