AWS Elemental MediaPackage Events - Amazon Elemental MediaPackage

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

AWS Elemental MediaPackage Events

AWS Elemental MediaPackage 与 Amazon CloudWatch Events 集成,以通知您影响您的通道和终端节点的特定事件。每个事件以 JSON (JavaScript 对象表示法) 格式表示,包含事件名称、事件发生的日期和时间、受影响的通道或终端节点等等。MediaPackage 尽最大努力发出事件。您可以使用 CloudWatch 事件收集这些事件,并设置将事件路由到一个或多个事件的规则。targets例如AWS Lambda函数、Amazon SNS 主题、Amazon SQS 队列、Amazon Kinesis 数据流中的流或内置目标。

有关将 CloudWatch 事件与其他类型的事件结合使用的更多信息,请参阅Amazon CloudWatch Events 用户指南

以下主题介绍 AWS Elemental MediaPackage 创建的 CloudWatch 事件。

输入通知

您可以获取实时内容和视频点播 (VOD) 内容的输入通知事件。当 MediaPackage 提取发生某些情况时,这些事件会通知您。下面是您可能会收到的输入通知事件:

  • 已超出最大输入流

  • 输入切换

  • VOD 提取状态更改

  • VOD 播放就绪性

以下各部分介绍了这些事件中的每个事件。

“已超出最大输入流”事件

对于直播内容,MediaPackage 中的通道超过了输入流数配额。有关配额的信息,请参阅AWS Elemental MediaPackage 中的配额

{ "id": "7bf73129-1428-4cd3-a780-95db273d1602", "detail-type": "MediaPackage Input Notification", "source": "aws.mediapackage", "account": "aws_account_id", "time": "2015-11-11T21:29:54Z", "region": "us-west-2", "resources":[ "arn:aws:mediapackage:us-west-2:aws_account_id:channels/262ff182d46d4b399fcabea1364df682" ], "detail":{ "event": "MaxIngestStreamsError", "message": "Parent Manifest [%s] has [23] streams, more than [20] allowed: (index_1.m3u8,index_2.m3u8,index_3.m3u8,index_4.m3u8,index_5.m3u8,index_6.m3u8,index_7.m3u8,index_8.m3u8,index_9.m3u8,index_10.m3u8,index_11.m3u8,index_12.m3u8,index_13.m3u8,index_14.m3u8,index_15.m3u8,index_16.m3u8,index_17.m3u8,index_18.m3u8,index_19.m3u8,index_20.m3u8,index_21.m3u8,index_22.m3u8,index_23.m3u8)" } }
输入切换事件

对于直播内容,MediaPackage 切换您的某个终端节点的输入。

每五分钟发送一个事件。如果输入在五分钟内多次切换(例如,如果 MediaPackage 切换到一个输入,然后切换回另一个输入),则您只会收到一个事件。

有关输入冗余以及什么导致切换输入的信息,请参阅实时输入冗余 AWS 元素媒体包存处理流

{ "id": "8f9b8e72-0b31-e883-f19c-aec84742f3ce", "detail-type": "MediaPackage Input Notification", "source": "aws.mediapackage", "account": "aws_account_id", "time": "2018-07-16T17:29:36Z", "region": "us-east-1", "resources":[ "arn:aws:mediapackage:us-east-1:aws_account_id:origin_endpoints/82d6b9bc04cb4612b487963d6c8d0f1a" ], "detail":{ "event": "InputSwitchEvent", "message": "Origin endpoint experienced an Input Switch Event" } }
VOD 提取状态事件

对于视频点播 (VOD) 内容,MediaPackage 中的资产会改变提取状态。您将收到以下事件的通知:

  • IngestStart

  • IngestError

  • IngestComplete

{ "id": "8f9b8e72-0b31-e883-f19c-aec84742f3ce", "detail-type": "MediaPackage Input Notification", "source": "aws.mediapackage", "account": "aws_account_id", "time": "2019-05-03T17:29:36Z", "region": "us-west-2", "resources":[ "arn:aws:mediapackage-vod:us-west-2:aws_account_id:assets/asset_name" ], "detail":{ "event": "IngestComplete", "message": "message text" } }
VOD 播放事件

对于 VOD 内容,MediaPackage 中的资产可供播放。从资产提取完成到可播放资产之间,会有一段时间。事件VodAssetPlayable表示 MediaPackage 现在可以满足资产的播放请求。

你会得到单个VodAssetPlayable事件中的每个打包配置。例如,如果您的包装组包含一个 DASH 和一个 HLS 打包配置,您会收到两个VodAssetPlayable事件 — 一个用于您的 DASH 打包配置,另一个用于 HLS 打包配置。

{ "id": "81e896e4-d9e5-ec79-f82a-b4cf3246c567", "detail-type": "MediaPackage Input Notification", "source": "aws.mediapackage", "account": "aws_account_id", "time": "2019-11-03T21:46:00Z", "region": "us-west-2", "resources":[ "arn:aws:mediapackage-vod:us-west-2:aws_account_id:assets/asset_id", "arn:aws:mediapackage-vod:us-west-2:aws_account_id:packaging_configuration/packaging_configuration_id" ], "detail":{ "event": "VodAssetPlayable", "message": "Asset 'asset_id' is now playable for PackagingConfiguration 'packaging_configuration_id'", "packaging_configuration_id": "packaging_configuration_id", "manifest_urls":[ "https://555555555555.egress.mediapackage-vod.us-west-2.amazonaws.com/out/v1/b9cc115bf7f1a/b848dfb116920772aa69ba/a3c74b1cae6a451c/index.m3u8" ] } } { "id": "91e896e4-d9e5-ab80-f82a-b4cf3246c568", "detail-type": "MediaPackage Input Notification", "source": "aws.mediapackage", "account": "aws_account_id", "time": "2019-11-03T21:47:00Z", "region": "us-west-2", "resources":[ "arn:aws:mediapackage-vod:us-west-2:aws_account_id:assets/asset_id", "arn:aws:mediapackage-vod:us-west-2:aws_account_id:packaging_configuration/packaging_configuration_id" ], "detail":{ "event": "VodAssetPlayable", "message": "Asset 'asset_id' is now playable for PackagingConfiguration 'packaging_configuration_id'", "packaging_configuration_id": "packaging_configuration_id", "manifest_urls":[ "https://111122223333.egress.mediapackage-vod.us-west-2.amazonaws.com/out/v1/1234567890abc/021345abcdef6789012345/abcdef0123456789/index.mpd" ] } }

密钥提供者通知事件

当您在终端节点上使用内容加密,MediaPackage 将无法访问该密钥提供程序时,您会获得密钥提供程序通知事件。有关 DRM 和加密的信息,请参阅 https://docs.aws.amazon.com/speke/latest/documentation/

{ "id": "7bf73129-1428-4cd3-a780-98ds273d1602", "detail-type": "MediaPackage Key Provider Notification", "source": "aws.mediapackage", "account": "aws_account_id", "time": "2015-11-11T21:29:54Z", "region": "us-west-2", "resources":[ "arn:aws:mediapackage:us-west-2:aws_account_id:origin_endpoints/70b44e2e666c4bdc9e5f4488e1f1aa99" ], "detail":{ "event": "KeyProviderError", "message": "message-text" } }

收获作业通知

从直播中导出片段以创建直播转点播资产时,您会获得采集作业状态事件。当收集作业成功或失败时,MediaPackage 会创建通知。有关采集作业和直播转点播资产的信息,请参阅 使用 AWS MediaPackage (AWS Elemental MediaPackage 创建直播转点播资产

例 成功的收获工作活动

{ "id": "8f9b8e72-0b31-e883-f19c-aec84742f3ce", "detail-type": "MediaPackage HarvestJob Notification", "source": "aws.mediapackage", "account": "aws_account_id", "time": "2019-07-16T17:29:36Z", "region": "us-east-1", "resources":[ "arn:aws:mediapackage:us-east-1:aws_account_id:harvest_jobs/harvest_job_id" ], "detail":{ "harvest_job": { "id": "harvest_job_id", "arn": "arn:aws:mediapackage-vod:us-east-1:aws_account_id:harvest_jobs/harvest_job_id", "status": "SUCCEEDED", "origin_endpoint_id": "endpoint_id", "start_time": "2019-06-26T20:30:00-08:00", "end_time": "2019-06-26T21:00:00-08:00", "s3_destination": { "bucket_name": "s3_bucket_name", "manifest_key": "path/and/manifest_name/index.m3u8", "role_arn": "arn:aws:iam::aws_account_id:role/S3Access_role", }, "created_at": "2019-06-26T21:03:12-08:00" } } }

例 失败的收获作业事件

{ "id": "8f9b8e72-0b31-e883-f19c-aec84742f3ce", "detail-type": "MediaPackage HarvestJob Notification", "source": "aws.mediapackage", "account": "aws_account_id", "time": "2019-07-16T17:29:36Z", "region": "us-east-1", "resources":[ "arn:aws:mediapackage:us-east-1:aws_account_id:harvest_jobs/harvest_job_id" ], "detail":{ "harvest_job": { "id": "harvest_job_id", "arn": "arn:aws:mediapackage-vod:us-east-1:aws_account_id:harvest_jobs/harvest_job_id", "status": "FAILED", "origin_endpoint_id": "endpoint_id", "start_time": "2019-06-26T20:30:00-08:00", "end_time": "2019-06-26T21:00:00-08:00", "s3_destination": { "bucket_name": "s3_bucket_name", "manifest_key": "path/and/manifest_name/index.m3u8", "role_arn": "arn:aws:iam::aws_account_id:role/S3Access_role", }, "created_at": "2019-06-26T21:03:12-08:00" }, "message": "Message text" } }