Granting access to the MTS service

Updated at:

Content Moderation calls ApsaraVideo Media Processing (formerly MTS) to capture frames from videos that you upload to Object Storage Service (OSS). You must authorize ApsaraVideo Media Processing to submit video frame capture tasks on behalf of Content Moderation using the role management feature of Resource Access Management (RAM). This topic describes how to complete this authorization.

Background information

  • When you submit an asynchronous video moderation task and specify the video by providing its OSS URL, Content Moderation automatically captures frames from the video. You must complete the authorization described in this topic to ensure that the automatic frame capture feature works correctly.

  • OSS is available in the following regions: China (Hangzhou), China (Shanghai), China (Beijing), and China (Shenzhen).

Procedure

  1. Create a RAM role and grant permissions.

    Create a service role for ApsaraVideo Media Processing in your Alibaba Cloud account. This role will be assumed by the Content Moderation service account.

    1. Log on to the RAM console.

    2. In the navigation pane, choose Identities > Roles.

    3. On the Roles page, click Create Role.

    4. In the Create Role panel, select Alibaba Cloud Service as the trusted entity type, and then click Next.

    5. Select Service Role, enter a Role Name, select ApsaraVideo Media Processing as the trusted service, and then click Complete.

      Note

      This operation may require phone verification.

    6. After the role is created, click Grant Permission.

    7. In the Add Permission panel, grant the AliyunOSSReadOnlyAccess system policy to the role, and then click OK.

      This grants the service role read-only access to the OSS data in your Alibaba Cloud account.

  2. Modify the trust policy of the service role.

    1. On the Roles page, click the name of the role that you created to go to the role details page.

    2. Click the Trust Policy Management tab, and then click Edit Trust Policy.

    3. On the Edit Trust Policy page, replace the value of "Service" with "118484706224****@mts.aliyuncs.com", and click OK.

      This operation authorizes the Alibaba Cloud account for Content Moderation (UID: 118484706224****) to assume the service role and call the MTS service.

What to do next

After you complete the authorization, you must provide the URL of the video object in a specific format when you submit an asynchronous video moderation task for an OSS video.

  1. On the role details page, view and copy the ARN (Alibaba Cloud Resource Name) of the role.

  2. Construct the URL for the OSS video object that you want to moderate. Use the following format: oss://arn@bucket.region/object

    For example, to process the video object video/bar.mp4 in the OSS bucket f** in the China (Shenzhen) region, the generated URL is oss://acs:ram::118484706224****:role/mts-to-a@f**.cn-shenzhen/video/bar.mp4, where 118484706224**** is your 16-digit Alibaba Cloud account ID.

  3. When you submit an asynchronous video moderation task, provide the constructed URL as the object to moderate.

    Note

    You can provide a video URL for asynchronous video moderation tasks only. For more information, see Asynchronous detection.