This topic shows you how to use ApsaraVideo Media Processing (MPS), from activating the service to submitting a media processing job.
Process overview
Prerequisites
Create an Alibaba Cloud account and complete real-name verification. For more information, see Create an Alibaba Cloud account.
Step 1: Activate the service
-
Activate the ApsaraVideo Media Processing (MPS) service. For detailed instructions, see Activate the service.
-
(Recommended) Create a RAM user for MPS and grant permissions. For detailed instructions, see Create a RAM user and grant permissions.
NoteWe recommend using RAM users to assign specific permissions. If multiple users collaborate on resources, grant each user only the minimum required permissions. This practice avoids sharing your Alibaba Cloud account or AccessKey pair, which reduces security risks.
Step 2: Upload and store files
-
Log on to the Object Storage Service (OSS) console. In the left-side navigation pane, click Buckets, and then click Create bucket.
-
In the Create Bucket panel, configure the parameters as prompted.
-
Click OK.
ImportantThe bucket must be in a region where the MPS features you use are available. If you want to store input and output files in different buckets, repeat the preceding steps to create another bucket.
-
Upload the file that you want to process.
-
On the Buckets page, click the name of the bucket to which you want to upload the file. Go to the page.
-
Click Upload and select the file that you want to upload.
-
After the file status changes to Ready to upload, click Upload.
When the file status in the job list changes to Uploaded, the upload is complete.
-
Step 3: Enable an MPS queue
Different types of jobs require different types of MPS queues. For details about queue types and how to enable them, see Enable an MPS queue.
-
Log on to the MPS console.
-
In the top navigation bar, select the same region as your OSS bucket.
-
In the left-side navigation pane, choose .
-
Find the required MPS queue type, click Enable in the Actions column, and set a name for the MPS queue.
NoteIf the required MPS queue type is not available, go to the page in the MPS console to create one. For more information, see Enable an MPS queue.
(Optional) Step 4: Configure media templates
MPS provides preset templates. If they meet your requirements, you can skip this step. Otherwise, create a custom template.
-
Preset transcoding templates include templates for standard transcoding, audio-only transcoding, transmuxing, Narrowband HDTM, and resolution enhancement. For more information, see Preset template details.
-
Custom templates include transcoding templates and watermark templates. You can create them in the console or by calling API operations. For instructions, see Manage templates.
Step 5: Create a media processing job
You can submit various media processing jobs by using the MPS console or by calling API operations. You can create a single job or a workflow.
-
Create a single media processing job in the console
-
In the left-side navigation pane, click Job management to go to the job creation page.
-
Select the required tab, click Create job, and configure parameters such as the file, MPS queue, and template. For more information, see Job management.
NoteTo create media processing jobs by calling API operations, see the relevant operations in API reference.
-
-
Create a media processing workflow in the console
-
In the left-side navigation pane, choose , and then click Create workflow.
-
Configure parameters such as the input file, workflow nodes, and trigger type as required.
-
-
You can also create jobs programmatically by using the operations in the API reference.
Step 6: Check the job result
After submitting a job, you can check the result in the following ways:
-
On the Job management page of the MPS console, view the job status and details in the job list.
-
Call an API operation to query the job status. For example, for a transcoding job, you can call the QueryJobList operation to query multiple transcoding jobs in a batch by using their job IDs.
-
Use Simple Message Queue (formerly MNS) to receive message notifications. For more information, see Configure message notifications.