After you activate ApsaraVideo for VOD, the system automatically allocates a dedicated Object Storage Service (OSS) bucket to you. You can use this bucket to store media files such as video, audio, image, and subtitle files. You can also use this bucket as an origin to accelerate content delivery through Content Delivery Network (CDN). If you have a large number of media files stored in a user-created OSS bucket and it takes efforts to migrate these resources to the dedicated bucket, you can add the user-created bucket to ApsaraVideo for VOD.
The differences between the dedicated bucket and user-created bucket are as follows:
Supported features: The dedicated bucket supports all features of ApsaraVideo for VOD. A user-created bucket may not support some of the new features. Currently, new features, such as uploading, transcoding (including encryption), snapshots, and AI processing (review and DNA) are all supported. However, we do not guarantee that user-created buckets will support the new features released in later versions.
Management: ApsaraVideo for VOD manages the logical relations between media resources in the console and media files in buckets, which is more simple and efficient. If you use a user-created bucket, you only manage the media files. You cannot modify or delete media files stored in your bucket without changing the corresponding media resource information. If you want to delete a video or image file, we recommend that you use the ApsaraVideo for VOD API.
Pricing: The dedicated bucket is more cost-effective. The fees of storage and outbound traffic over Internet are charged at the same prices as OSS. However, you do not need to pay for rerouting requests back to origins through CDN or calling the ApsaraVideo for VOD API. In addition, ApsaraVideo for VOD provides 50 GB of storage space, which is free of charge.
A user-created OSS bucket supports the basic features of ApsaraVideo for VOD. Only OSS storage fees are charged. ApsaraVideo for VOD does not charge any storage fee.
A user-created OSS bucket must reside in a region that supports ApsaraVideo for VOD, such as China (Beijing) and China (Shanghai). For more information about the available regions, see VOD centers and access domains.
Media transcoding in ApsaraVideo for VOD is based on ApsaraVideo for Media Processing. If your bucket is already added to ApsaraVideo for Media Processing, you cannot add it to ApsaraVideo for VOD.
Activate ApsaraVideo for VOD. If you have activated ApsaraVideo for VOD, skip this step. Then, use Resource Access Management (RAM) to authorize ApsaraVideo for VOD and the transcoding service and complete the basic configurations of ApsaraVideo for VOD.
Use RAM to grant ApsaraVideo for VOD the permission to access your OSS resources. To complete the authorization, click here.
Use RAM to grant ApsaraVideo for Media Processing the permission to access your OSS resources.
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.
In the Configure Role step, select Media Transcoding Service as the trusted service.
Set the RAM role name to
vod-pass-mpsand click Create, as shown in the following figure.
- After you create the RAM role, close the dialog box and go back to the RAM Roles page. Click
vod-pass-mpsin 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:
In the RAM console, click Policies in the left-side navigation pane and click Create Policy, as shown in the following figure.
Configure the policy, as shown in the following figure.
Set the policy name to
vod-pass-mps and replace the policy content with the following code:
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.
- After you complete the preceding authorization, add a user-created OSS bucket to ApsaraVideo for VOD. You can submit a ticket or contact the ApsaraVideo for VOD service team offline to express your expectation of using a user-created OSS bucket. You are required to provide the account ID, bucket name, and region.You can find your account ID on the Security Settings page in the Account Management console.
- Log on to the ApsaraVideo for VOD console and open the Domain Names page to add a domain name. On the Add Domain Name page, select OSS Domain Name and specify a
custom OSS origin.
- Go to the Transcode page. Configure a transcoding template and specify the default template group. If you do not want to use the transcoding feature, select No Transcoding. For more information, see Transcoding settings.
We recommend that you use the upload SDK of ApsaraVideo for VOD to upload a media resource. If you use the OSS API or SDK to directly upload a resource to the bucket, the resource cannot be transcoded in subsequent tasks.
To avoid this issue, you can use the OSS API or SDK to upload the resource to the storage of ApsaraVideo for VOD with an upload credential. For more information, see Upload URL and credential. This method is not recommended because it incurs additional development and debugging costs. For more information about how to use this method, see Upload videos by using the OSS native SDK.
For media resources that are stored in the bucket, you only need to register them with ApsaraVideo for VOD.
Use the OSS API or SDK to list all resource files stored in the bucket. An object list is returned. For more information, see View the object list.
Call the RegisterMedia operation to generate a media ID for the media resource that you want to register. The path of the media resource specified in the
FileURLparameter must include the OSS endpoint, for example:
- Call the SubmitTranscodeJobs or SubmitSnapshotJob operation to process the media resource with the specified media ID as required.