How to use custom OSS bucket with ApsaraVideo VOD

Kai Yang
4 min readNov 3, 2020

This article gives a step-by-step guide on how to use custom OSS bucket with ApsaraVideo VOD.

Activate ApsaraVideo Media Processing

To use custom OSS bucket with ApsaraVideo VOD, first we need to grant Media Processing access to Alibaba OSS. Go to the Media Processing page in Alibaba Cloud console, complete the real-name registration if you have not done so. You will see an authorization page after login to the console.

Click the “Activate Authorization” button to grant access to OSS.

Follow the prompts to finish the MPS activation. By the end of the process, your MPS will be activated with access from OSS.

Create a RAM role

  1. Log on to the RAM console and open the RAM Roles page. Click Create RAM Role. In the right-side dialog box that appears, select Alibaba Cloud Service and click Next.
  2. In the Configure Role step, select Media Transcoding Service as the trusted service.
  3. Set the RAM role name to vod-pass-mps and click Create, as shown in the following figure.
  4. After you create the RAM role, close the dialog box and go back to the RAM Roles page. Click vod-pass-mps in the RAM role list. On the page that appears, click the Trust Policy Management tab and then the Edit Trust Policy button, as shown in the following figure.

Replace the code framed in red with the following code:

{
"Statement": [{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": { "Service": [
"1874305272421199@mts.aliyuncs.com"
] }
}],
"Version": "1"
}

Create a RAM policy

  1. In the RAM console, click Policies in the left-side navigation pane and click Create Policy, as shown in the following figure.
  2. Configure the policy, as shown in the following figure.

3. Set the policy name to vod-pass-mps and replace the policy content with the following code:

{
"Statement": [{
"Action": "oss:*
"Effect": "Allow",
"Resource": [ "acs:oss:*:*:*", "acs:oss:*:*:*/*"]
}],
"Version": "1"
}

Assign RAM policy to RAM role

In the RAM console, click RAM Roles in the left-side navigation pane. On the RAM Roles page, find the RAM role vod-pass-mps and click Add Permissions in the Actions column. In the right-side dialog box that appears, find and click the vod-pass-mps policy to add it to the Selected section on the right. Then, click OK. The following figure shows these steps.

Now we have all the permission needed to add custom buckets to VOD service.

Add Custom OSS Bucket

Go to VOD console, and click on Storage under Media Management in the left-side navigation pane. In Storage, click the “Add User-created Bucket” button to see the list of custom buckets available in that region. Select the custom OSS bucket you want to use for VOD service, and click OK to add the bucket.

Now we have VOD service linked to an user-created OSS bucket, any video contents uploaded to VOD will be stored into the assigned bucket, and users can see those files in the OSS console as well as in the VOD console. However, in terms of supported features and cost, the default VOD bucket is more cost-effective, and has better VOD feature support. For new features such as uploading, transcoding (including encryption), snapshots, and API processing, both bucket types are supported. But there is no guarantee on feature support on any of the new features released in later versions.

--

--

Kai Yang

Ph.D in Semantic Web, Multi-Cloud Technical Leadship, WeChat Development Veteran, Polyglot Coder with Love