By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.

Step-by-Step: Implement Chime Media Pipelines for Seamless Cloud Meeting Capture

February 2, 2024

Introduction

Amazon Chime is a service provided within the AWS cloud infrastructure that brings streamlined communication experiences to the cloud. It has emerged as a frontrunner that enables meetings, chats and calls along with useful utilities like recording, AI-based audio transcription and a seamless integration with other Amazon services.

At Ensolvers, we’re always looking for new solutions that aim to enhance productivity and team-based collaboration within the applications and platforms we develop. Technologies and services like Chime are examples of tools and integrations that allow that help to that purpose and it can be applied to a wide range of applications ranging from education and healthcare to business and even data analysis. 

In this article, we’re going to learn about how Amazon Chime can be used to perform and record live meetings, including both audio and video. What we describe here is the journey of research and development we have to do to implement it as a part of one of the products we are developing.

How-to guide

First off, some prerequisites to implement a solution that captures our meetings to the cloud are:

  • Basic knowledge of the AWS SDK in the language of your choice.
  • A working implementation of Amazon Chime meetings.
  • S3 buckets in the same account where the meetings are hosted.
  • Your AWS account with admin role or a role with a policy allowing chime:*, s3:GetBucketPolicy and s3:GetBucketLocation.

Having all of these, we’re going to start configuring our buckets to receive the captured video. This can be easily accomplished by going into the bucket config and clicking the Permissions tab, where we can edit the Bucket policy. In that screen, we need to paste the following JSON:

Take into account that you need to change <your-recordings-bucket> and <your_account_id> to the name of the bucket you have destined for recordings, and your Account ID, which you can find on the top right corner:

That will allow the Chime MediaPipelines -the AWS service that allows us to record our cloud meetings- to read and write files to the desired bucket. Once configured, choose the language of your preference and integrate the Chime SDK MediaPipelines client into your project - you can find the one you need here. In this tutorial we’re going to use the Java client.

Now, we need to dig into our application backend and find the part where the Chime SDK meetings are started, because we’re going to make two API calls. The first one which will join a special kind of user, that will record the meeting into 5-second chunks of video in the following layout depicted

In this context, the "sink" refers to the final destination where all the captured meeting content is deposited, so here we’ll need to replace <destination-bucket-and-path> with the name of our bucket and the path where we want to store the meeting, along with <meeting-arn> with the value contained in the response of the Meeting we’ve just created and .

An analogous request can be done by using the AWS Java SDK as following

In this example we use the meeting ID as the "filename" to store the final recording so we associate it directly to the meeting, making it easier to find. Now, the next step is to concatenate all of the chunks into one single video. This can be done by running the following POST request

You will need to replace the destination in which you want your resulting recording to be stored (<destination-bucket-and-path>) and the <pipeline-arn> with the ARN that we can obtain from the response of the CreateMediaCapturePipeline request. Now, we will use the CreateMediaCapturePipeline request, and build and send it the same way we did in the previous step.

We’re ready to go! When you end your meeting (this has to be done manually in your implementation), the pipelines will be automatically stopped and we will have the recorded meeting available in the path we indicated as destination in a matter of minutes.

With our desired outcome available in our S3 bucket, we can generate a pre-signed URL that can be shared to anyone to watch and download the result, or included in a frontend for our app. A more complete approach would be creating a CloudFront distribution pointing to our S3 bucket, allowing for optimized streaming and features like video transcoding for different devices and internet connection speeds.

Conclusion/future work

Throughout this article we learned how we can rapidly implement a recording feature for our Amazon Chime Meetings. Although this implementation constitutes a minimal working example, it showed the power behind the MediaCapturePipeline and MediaConcatenationPipeline services that Chime offers.

Interested in our services?
Please book a call now.