Content Moderation calls ApsaraVideo for Media Processing to capture frames for the videos that are uploaded to Object Storage Service (OSS). 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. You must use the role management feature of Alibaba Cloud Resource Access Management (RAM). This topic describes how to perform the required steps.
- If you submit an asynchronous video moderation task and specify the video URL in the oss://xxxx format, Content Moderation can automatically capture frames for the video that is uploaded to OSS. To ensure automatic frame capture, you must authorize a role to access ApsaraVideo for Media Processing.
- The OSS service is available in the China (Hangzhou), China (Shanghai), China (Beijing), and China (Shenzhen) regions.
- Create a RAM role and grant permissions.Create a RAM role that can access ApsaraVideo for Media Processing for your Alibaba Cloud account. Authorize your Alibaba Cloud account to assume the role.
- Log on to the RAM console.
- Go to the RAM Roles page. Then, click Create RAM Role.
- Select Alibaba Cloud Service as the trusted entity type 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 Add Permissions panel, select the AliyunOSSReadOnlyAccess policy and click OK.This operation grants the RAM role only read permissions on OSS data that belongs to your Alibaba Cloud account.
- Modify the trust policy of the RAM role.
- On the RAM Roles page, click the name of the created role to go to the role details page.
- Click the Trust Policy Management tab and then click Edit Trust Policy.
- In the Edit Trust Policy panel, 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 RAM role to call ApsaraVideo for Media Processing. Content Moderation is also used within this Alibaba Cloud account.
What to do next
- On the role details page, view and copy the Alibaba Cloud resource name (ARN).
- Generate the video URL for a video to be moderated in OSS in the following format:
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 URL of the video is
xxxxxxxxxxxxxxxxis the 16-digit ID of your Alibaba Cloud account.
- When you submit an asynchronous video moderation task, use the generated video URL.
- 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 Asynchronous moderation.
- The supported regions are China (Hangzhou), China (Shanghai), China (Beijing), and China (Shenzhen).