Content Moderation calls ApsaraVideo for Media Processing to capture video frames. In this way, data is accessed over the internal network to minimize the costs of Internet traffic. You must authorize a role to access ApsaraVideo for Media Processing. Then, Content Moderation can use the role to submit a video frame capture task. This topic describes how to create and authorize a role in the Resource Access Management (RAM) console.
- A RAM role is created for your Alibaba Cloud account and used by Content Moderation
to call ApsaraVideo for Media Processing.
For more information about RAM roles, see RAM role overview.
- The RAM role is granted the permission to access your Object Storage Service (OSS) buckets in the read-only mode.
- Video URLs to be submitted are generated in the oss://xxxx format.
Note The method of submitting a video URL to specify the video to be moderated is available only for asynchronous video moderation tasks. For more information, see Moderate videos asynchronously.
After a role is authorized, Content Moderation under your Alibaba Cloud account can use the role to call ApsaraVideo for Media Processing, access your OSS buckets, and then capture frames for videos in your OSS buckets.
- Create a RAM role.
- Log on to the RAM console.
- In the left-side navigation pane, click RAM Roles. On the RAM Roles page, click Create RAM Role.
- In the Create RAM Role right-side pane that appears, select Alibaba Cloud Service and click Next.
- Set the RAM Role Name parameter and select Media Transcoding Service from the Select Trusted Service drop-down list.
- Click OK.
Note This operation may require mobile phone-based authentication.
- After the role is created, click Add Permissions to RAM Role in the Create RAM Role right-side pane.
- In the Add Permissions right-side pane that appears, select the AliyunOSSReadOnlyAccess policy and click OK.
This policy grants the role the permission to access OSS buckets under your Alibaba Cloud account in the read-only mode.
- Modify the trust policy.
- On the RAM Roles page, find the created role and click the role name to view details.
- Click the Trust Policy Management tab and then click Edit Trust Policy.
- In the Edit Trust Policy right-side pane that appears, replace the content of
"firstname.lastname@example.org". Click OK.This operation specifies that the Alibaba Cloud account whose UID is 1184847062244573 assumes the created role to call ApsaraVideo for Media Processing.
- On the role details page, view and copy the Alibaba Cloud resource name (ARN) in the Basic Information section.
- Generate the video URL for a video to be moderated in an OSS bucket in the following
oss://email@example.com/object.Assume that you want to moderate the video/bar.mp4 object in the foo OSS bucket that resides in the China (Shenzhen) region. The generated OSS URL of the video is
xxxxxxxxxxxxxxxxis the 16-digit ID of your Alibaba Cloud account.Note The following regions support the preceding operation: China (Hangzhou), China (Shanghai), China (Beijing), and China (Shenzhen).
- When you submit an asynchronous video moderation task, use the generated video URL.