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 help to that purpose and they 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.
First off, some prerequisites to implement a solution that captures our meetings to the cloud are:
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 start, 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.
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, 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.
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.