Creating Amazon Chime SDK media stream pipelines
The chime media stream pipeline must belong to the same AWS account as the Amazon Chime SDK meeting. You create the Amazon Chime SDK media stream pipeline by calling the CreateMediaStreamPipeline API and specifying a source and a sink.
The following diagram shows the architecture of an Amazon Chime SDK media stream pipeline. Numbers in the diagram correspond to the numbered text below.
In the diagram:
-
You call the
CreateMediaStreamPipelineAPI. In the request, specify the sources and sinks for the streams. whether you want to capture individual audio, mixed audio, or both. Include the ARN of your KVS pool in the request.-
The sources array consists of the
SourceTypeandSourceArn. You must use theChimeSdkMeeting SourceType. TheSourceArnis the ARN of theChimeSdkMeeting. -
The sinks array consists of the
SinkType,SinkArn,ReservedStreamCapacity, andMediaStreamType. We only support theKinesisVideoStreamPoolSinkType. TheSinkArnis the ARN of theKinesisVideoStreamPool. TheMediaStreamTypecontrols the type of media streamed to the sink, eitherMixedAudioorIndividualAudio.ReservedStreamCapacitysets the number of streams allocated for theMediaStreamTypefrom theKinesisVideoStreamPool.-
If you want to stream both
IndividualAudioandMixedAudio, create two sink objects in theSinksarray, one forIndividualAudio, another forMixedAudio. TheSinkArn(the ARN of theKinesisVideoStreamPool) can vary for each sink. -
To stream just individual audio or mixed audio, create one sink object with the desired
MediaStreamType.
-
-
Note the following:
-
When invoking the CreateMediaStreamPipeline API with
KinesisVideoStreamPoolas theSinkType, theSinkARNmust belong to the control plane region in whichCreateMediaStreamPipelineis being invoked.For example, if you create a media stream pipeline in
us-east-1, you must use aKinesisVideoStreamPoolinus-east-1. -
ReservedStreamCapacityshould be1when you specify theMixedAudioMediaStreamType, and between1-10when you specify theIndividualAudioMediaStreamType.
-
-
-
The media pipeline data plane calls the KVS PutMedia API to store individual audio in a KVS stream that belongs to the KVS pool that you specify.
-
The media pipeline data plane calls the KVS
PutMediaAPI to store mixed audio in a stream that belongs to the KVS pool that you specify.
Note
After calling the CreateMediaStreamPipeline API, builders can use
media pipeline events or call the
GetMediaPipeline API to determine if the pipeline state
is InProgress.
Once the pipeline state reaches InProgress, the media—any
combination of IndividualAudio and
MixedAudio—streams to KVS.
For the IndividualAudio stream type, a 1:1 mapping exists between
attendee IDs and the KVS stream allocated from the
KinesisVideoStreamPool. The mapping applies for the life of the
media pipeline.
To know which KVS stream maps to an attendee ID, or is assigned for MixedAudio, use one of the following techniques:
-
Use Event Bridge Notifications. Each notification provides information such as attendee IDs and the KVS ARN that streams the attendee’s audio. When a
IndividualAudioorMixedAudiostreaming session starts, we send achime:MediaPipelineKinesisVideoStreamStartevent. Streaming sessions end when an attendee leaves the call (forIndividualAudio), or when the meeting ends. -
Use the persistent metadata that the Kinesis Video Streams send with each fragment. The metadata contains information similar to what Event Bridge sends. Builders need to parse all the streams of the
KinesisVideoStreamPoolby specifying the pool name as the prefix in the ListStreams Kinesis Video Streams API using this solution.
Media Stream pipeline termination happens when the meeting is deleted, or the DeleteMediaPipeline API is invoked for that media stream pipeline. An Event Bridge notification is also sent to indicate the media pipeline termination.