本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
媒體串流管道的範例程式碼
下列範例示範如何建立混合音訊、個別音訊和兩者的媒體串流管道。展開每個區段以進一步了解。
response = client.create_media_stream_pipeline( Sources=[ { 'SourceType': 'ChimeSdkMeeting', 'SourceArn': 'arn:aws:chime:
us-east-1
:account-ID
:meeting/bed804cf-8cf0-4991-9b8d-d1acc2987433
' }, ], Sinks=[ { 'SinkArn': 'arn:aws:chime:us-east-1
:account-ID
:media-pipeline-kinesis-video-stream-pool/foo
', 'SinkType': 'KinesisVideoStreamPool', 'ReservedStreamCapacity': 1, 'MediaStreamType': 'MixedAudio' }, ], ClientRequestToken='sample token
', Tags=[ { 'Key': 'sample key
', 'Value': 'sample value
' }, ] )
回應:
{ 'MediaStreamPipeline': { 'MediaPipelineId': '
45bc79a0-4591-4ebe-a642-d42c4e279f2d
', 'MediaPipelineArn': 'arn:aws:chime:us-east-1
:account-ID
:media-pipeline/45bc79a0-4591-4ebe-a642-d42c4e279f2d
', 'CreatedTimestamp': '2023-07-25T21:48:48.265Z
', 'UpdatedTimestamp': '2023-07-25T21:48:48.376Z
', 'Status': 'Initializing', 'Sources': [ { 'SourceType': 'ChimeSdkMeeting', 'SourceArn': 'arn:aws:chime:us-east-1
:account-ID:meeting/bed804cf-8cf0-4991-9b8d-d1acc2987433
' }, ], 'Sinks': [ { 'SinkArn': 'arn:aws:chime:us-east-1
:account-ID
:media-pipeline-kinesis-video-stream-pool/foo
', 'SinkType': 'KinesisVideoStreamPool', 'ReservedStreamCapacity': 1, 'MediaStreamType': 'MixedAudio' }, ] } }
response = client.create_media_stream_pipeline( Sources=[ { 'SourceType': 'ChimeSdkMeeting', 'SourceArn': 'arn:aws:chime:
us-east-1
:account-ID
:meeting/bed804cf-8cf0-4991-9b8d-d1acc2987433
' }, ], Sinks=[ { 'SinkArn': 'arn:aws:chime:us-east-1
:account-ID
:media-pipeline-kinesis-video-stream-pool/foo
', 'SinkType': 'KinesisVideoStreamPool', 'ReservedStreamCapacity':5
, 'MediaStreamType': 'IndividualAudio' }, ], ClientRequestToken='sample token
', Tags=[ { 'Key': 'sample key
', 'Value': 'sample value
' }, ] )
回應:
{ 'MediaStreamPipeline': { 'MediaPipelineId': '
45bc79a0-4591-4ebe-a642-d42c4e279f2d
', 'MediaPipelineArn': 'arn:aws:chime:us-east-1
:account-ID
:media-pipeline/45bc79a0-4591-4ebe-a642-d42c4e279f2d
', 'CreatedTimestamp': '2023-07-25T21:48:48.265Z
', 'UpdatedTimestamp': '2023-07-25T21:48:48.376Z
', 'Status': 'Initializing', 'Sources': [ { 'SourceType': 'ChimeSdkMeeting', 'SourceArn': 'arn:aws:chime:us-east-1
:account-ID
:meeting/bed804cf-8cf0-4991-9b8d-d1acc2987433
' }, ], 'Sinks': [ { 'SinkArn': 'arn:aws:chime:us-east-1
:account-ID
:media-pipeline-kinesis-video-stream-pool/foo
', 'SinkType': 'KinesisVideoStreamPool', 'ReservedStreamCapacity':5
, 'MediaStreamType': 'IndividualAudio' }, ] } }
response = client.create_media_stream_pipeline( Sources=[ { 'SourceType': 'ChimeSdkMeeting', 'SourceArn': 'arn:aws:chime:
us-east-1
:account-ID
:meeting/bed804cf-8cf0-4991-9b8d-d1acc2987433
' }, ], Sinks=[ { 'SinkArn': 'arn:aws:chime:us-east-1
:account-ID
:media-pipeline-kinesis-video-stream-pool/foo
', 'SinkType': 'KinesisVideoStreamPool', 'ReservedStreamCapacity': 1, 'MediaStreamType': 'MixedAudio' }, { 'SinkArn': 'arn:aws:chime:us-east-1
:account-ID
:media-pipeline-kinesis-video-stream-pool/foo
', 'SinkType': 'KinesisVideoStreamPool', 'ReservedStreamCapacity':5
, 'MediaStreamType': 'IndividualAudio' }, ], ClientRequestToken='sample token
', Tags=[ { 'Key': 'sample key
', 'Value': 'sample value
' }, ] )
回應:
{ 'MediaStreamPipeline': { 'MediaPipelineId': '
45bc79a0-4591-4ebe-a642-d42c4e279f2d
', 'MediaPipelineArn': 'arn:aws:chime:us-east-1
:account-ID
:media-pipeline/45bc79a0-4591-4ebe-a642-d42c4e279f2d
', 'CreatedTimestamp': '2023-07-25T21:48:48.265Z
', 'UpdatedTimestamp': '2023-07-25T21:48:48.376Z
', 'Status': 'Initializing', 'Sources': [ { 'SourceType': 'ChimeSdkMeeting', 'SourceArn': 'arn:aws:chime:us-east-1
:account-ID
:meeting/bed804cf-8cf0-4991-9b8d-d1acc2987433
' }, ], 'Sinks': [ { 'SinkArn': 'arn:aws:chime:us-east-1
:account-ID
:media-pipeline-kinesis-video-stream-pool/foo
', 'SinkType': 'KinesisVideoStreamPool', 'ReservedStreamCapacity': 1, 'MediaStreamType': 'MixedAudio' }, { 'SinkArn': 'arn:aws:chime:us-east-1
:account-ID
:media-pipeline-kinesis-video-stream-pool/foo
', 'SinkType': 'KinesisVideoStreamPool', 'ReservedStreamCapacity':5
, 'MediaStreamType': 'IndividualAudio' }, ] } }