All Products
Search
Document Center

Add a user-created OSS bucket

Last Updated: Nov 13, 2020

After you activate ApsaraVideo VOD, ApsaraVideo VOD automatically allocates a dedicated Object Storage Service (OSS) bucket to you. You can use this bucket to store media resources such as video, audio, image, and subtitle files. You can also configure this bucket as an origin to accelerate the delivery of content from this bucket by using Content Delivery Network (CDN). However, you may have stored a large number of media resources in a bucket that you created in OSS before you activate ApsaraVideo VOD. If you do not want to migrate these resources to the dedicated OSS bucket that ApsaraVideo VOD allocates to you, you can add the user-created OSS bucket to ApsaraVideo VOD.

Differences between the dedicated and user-created OSS buckets

This section describes the differences between the dedicated and user-created OSS buckets from the following dimensions:

  • Supported features: The dedicated OSS bucket supports all features of ApsaraVideo VOD. You can use the dedicated OSS bucket to upload, transcode, encrypt, and play videos and take snapshots from videos. The dedicated OSS bucket also supports media review and media fingerprint processing.

  • Management: In addition to physical file management, ApsaraVideo VOD focuses on managing media resources in the dedicated OSS bucket in a logical way. Compared with user-created OSS buckets, the dedicated OSS bucket is simpler and more efficient to use. Media resources in the dedicated OSS bucket can be deleted or modified only in ApsaraVideo VOD. If you delete or modify media resources in the dedicated bucket from the OSS side, the resource status in the dedicated bucket may be different from that in ApsaraVideo VOD. If you want to delete or modify media resources such as video and image files, we recommend that you use the API of ApsaraVideo VOD.

  • Pricing: Compared with user-created OSS buckets, the dedicated OSS bucket is more cost-efficient. The storage and outbound traffic over the Internet of the dedicated OSS bucket are charged at the same prices as those of user-created OSS buckets. If you use the dedicated OSS bucket, you do not need to pay for CDN back-to-origin traffic or API requests. In addition, the dedicated OSS bucket provides you with a free quota of 50 GB storage.

Precautions

  • User-created OSS buckets support the basic features of ApsaraVideo VOD. If you use a user-created OSS bucket in ApsaraVideo VOD, only OSS storage fees are charged. ApsaraVideo VOD does not charge you extra fees.

  • You can use only a user-created OSS bucket that resides in a region of ApsaraVideo VOD, such as the China (Beijing) region or the China (Shanghai) region. For more information about the regions that ApsaraVideo VOD supports, see VOD centers and access domains.

  • Media transcoding in ApsaraVideo VOD is implemented based on ApsaraVideo for Media Processing. If a user-created OSS bucket is added to ApsaraVideo for Media Processing, you cannot add the bucket to ApsaraVideo VOD.

Procedure

Notice

If you use a user-created OSS bucket, we recommend that you use the upload SDK of ApsaraVideo VOD to upload media resources to the bucket. If you use the OSS API or OSS SDK to upload media resources to the bucket, the resources cannot be transcoded.

To process existing media resources that are stored in a user-created OSS bucket, submit a ticket.

  1. Activate ApsaraVideo VOD. If you have activated ApsaraVideo VOD, skip this step.

  2. Authorize ApsaraVideo VOD to access your OSS resources.

  3. Authorize ApsaraVideo for Media Processing to access your OSS resources so that you can use the transcoding feature.

    1. Log on to the Resource Access Management (RAM) console and go to the RAM Roles page.

    2. Click Create RAM Role. In the Create RAM Role panel, select Alibaba Cloud Service. Then, click Next.

      Create a RAM role

    3. In the RAM Role Name field, enter vod-pass-mps. Select Media Transcoding Service from the Select Trusted Service drop-down list. Then, click OK to create the RAM role.

      Configure a RAM role

    4. Go back to the RAM Roles page. Click the name of the created RAM role.

      RAM Roles

    5. On the management page of the RAM role, click the Trust Policy Management tab. Then, click Edit Trust Policy. In the Edit Trust Policy panel, modify the trust policy code as needed and click OK.

      The following figure shows a sample trust policy.Modify the trust policy

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

    6. In the left-side navigation pane, choose Permissions > Policies. On the Policies page, click Create Policy.

      Create a permission policy

    7. On the Create Custom Policy page, enter vod-pass-mps in the Policy Name field. Select Script for Configuration Mode. In the code editor that appears, configure the permission policy as needed. Then, click OK.

      The following figure shows a sample permission policy.Custom permission policy

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

    8. In the left-side navigation pane, click RAM Roles. On the RAM Roles page, click Add Permissions in the Actions column of the vod-pass-mps RAM role.

      Add permissions

    9. In the Add Permissions panel, select Custom Policy in the Select Policy section. Click the vod-pass-mps permission policy. Then, click OK.

      Attach a permission policy

  4. After the authorization is completed, go to the ApsaraVideo VOD console. On the Storage page, add a user-created OSS bucket. Make sure that the user-created OSS bucket resides in the region where your ApsaraVideo VOD service is activated.

  5. On the Domain Names page, add a domain name for CDN. You can use the user-created OSS bucket that you add to ApsaraVideo VOD, or specify another OSS domain name as the origin.

  6. On the Transcode page, create a transcoding template. Specify the default transcoding template group. If you do not need to use the transcoding feature, select the No Transcoding template group. For more information, see Transcoding settings.