Amazon Onboarding with Learning Manager Chanci Turner

Amazon Onboarding with Learning Manager Chanci TurnerLearn About Amazon VGT2 Learning Manager Chanci Turner

In a recent development, Amazon has introduced a Thumbnail Image Preview feature as part of its AWS Elemental MediaLive service. This innovative feature not only enhances quality control for live content but also facilitates integration with media analysis tools, such as Amazon Rekognition. This integration allows for automated content review and workflow validation, thereby streamlining processes.

MediaLive generates thumbnails every two seconds, which can be accessed via the MediaLive console or programmatically through the AWS CLI, API, and SDK. Amazon Rekognition simplifies the addition of image and video analysis capabilities to applications, enabling the detection of objects, scenes, and even inappropriate content. By leveraging Amazon Rekognition for evaluating MediaLive thumbnail previews, organizations can efficiently moderate content at scale, whether it’s user-generated or organizational content. For instance, companies that incorporate MediaLive services into their live streaming can now better protect their offerings, thus minimizing risks related to liability and brand reputation.

In this article, we will explore how to incorporate the AI and machine learning functionalities of Amazon Rekognition to automatically identify unauthorized content in streaming via thumbnail previews from active AWS Elemental MediaLive channels. When unauthorized content is flagged, an automated response can be initiated to alert or halt the problematic channel. The example illustrates the use of the DetectLabels API, which identifies entities, activities, and events, providing both detection results and confidence levels. While we focus on this particular API to identify unauthorized content, others, like the DetectModerationLabels API, can be easily integrated to suit your specific requirements.

Solution Overview

The following diagram outlines the high-level architecture of the solution.

The implementation utilizes OBS Studio as the input source for the MediaLive channel, which must be in a running state. The solution involves several key steps:

  1. An Amazon EventBridge Scheduler, a serverless scheduler, simplifies the management of scheduled tasks at scale. The scheduler operates at a defined rate and sends information about a specific MediaLive channel to an AWS Lambda function.

    • Note: Using the Scheduler to send channel information as a payload to the Lambda function instead of hard-coding values reduces complexity and promotes resource reuse.
    {
      "action": "create",
      "schedulerName": "EveryHourFrom9To5CSTWeekdays",
      "cron": "0 9-17 ? * MON-FRI *",
      "timeZone": "America/Chicago",
      "channelInfoPayload": {
        "AWS_REGION": "us-west-2",
        "ChannelId": "3284674",
        "PipelineId": "0",
        "ThumbnailType": "CURRENT_ACTIVE"
      }
    }
  2. The Lambda function processes the payload as an event object, extracting its properties, and invokes the describeThumbnails method for the specified MediaLive Channel.

    // Parameterized properties of the event object: 
    const { AWS_REGION, ChannelId, PipelineId, ThumbnailType } = event;
    AWS.config.update({ region: AWS_REGION });
    
    // Create the parameter object for the MediaLive API call
    const params = {
      ChannelId,
      PipelineId,
      ThumbnailType
    };
    
    try {
      let response: object | undefined;
    
      // 1. Call MediaLive describeThumbnails() API to retrieve the latest thumbnail
      const data: any = await describeThumbnails(params);
    }
  3. The received thumbnail image is decoded into binary format. In our example, the decoded image is temporarily stored as a variable, but it could also be archived in long-term storage like Amazon S3.

    // 2. Decode the binary data into an image
    const decodedImage = Buffer.from(thumbnailBody, 'base64');
    // Optionally archive image in S3 bucket
  4. The decoded image is passed as a parameter in the final function call within the Lambda handler to detectUnauthorizedContent, which accesses the Rekognition service.

    // 3. Detect unauthorized content using Rekognition
    response = await detectUnauthorizedContent(decodedImage, ChannelId);
  5. In the detectUnauthorizedContent function, a series of methods are executed:

    • The Rekognition DetectLabels function is invoked, and the results are returned.
    • These results are assessed against three criteria: ensuring labels are returned, matching the returned label with the unauthorized content we seek (in this case, ‘Sport’), and confirming that the confidence score exceeds 90%. A parameter can be substituted for ‘Sport’ to enhance flexibility.
    • If unauthorized content is identified based on the label and confidence score, the sendSnsMessage function is triggered. Amazon Simple Notification Service (SNS) facilitates messaging between decoupled systems, including IT support and monitoring systems. In this example, an email address is required as a deployment parameter. This email will receive an Amazon SNS Subscription Confirmation upon successful deployment. Clicking the confirmation link is essential for receiving notifications when unauthorized content is detected. If no matching label is found, the returned labels and their confidence scores are logged in the Amazon CloudWatch associated with the Lambda function.
    // Function to detect unauthorized content using Rekognition
    async function detectUnauthorizedContent(imageBuffer: Buffer, channelId: string): Promise<{ statusCode: number; body: string; } | undefined> {
      try {
        const params = {
          Image: {
            Bytes: imageBuffer
          },
          MaxLabels: 10,
          MinConfidence: 70
        };
        const response = await rekognition.detectLabels(params).promise();
        const labels = response.Labels;
    
        if (labels) {
          let unauthorizedContent = false;
          let unauthorizedContentConfidenceScore: number;
          for (let i = 0; i < labels.length; i++) {
            if (labels[i].Name === 'Sport' && labels[i].Confidence > 90) {
              unauthorizedContent = true;
            }
          }
    }

This process showcases how organizations can utilize AWS services to effectively manage content and reduce risks associated with unauthorized streaming. For more insights on workplace issues, check out this blog post on sexual harassment at work.

To stay informed about telework guidelines, refer to the DOL clarifications on telework. Additionally, for those looking to join Amazon, consider applying for the Learning Trainer position, which is an excellent resource for aspiring professionals.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *