@aws-cdk/aws-medialive-alpha

中文文档
2.275.0-alpha.0发布于 2026/10/27Apache-2.0TypeScriptCommonJS零依赖近 30 天下载 2401

用于 MediaLive 的 CDK 构建库

中文使用文档
文档目录47 节
  1. AWS 元素介质Live
  2. 投入
  3. SRT 呼叫器
  4. SRT 监听器
  5. AWS 元素介质连接路由器
  6. 来自 S3 的 MP4 文件
  7. 导入已有输入
  8. 输入安全组
  9. 导入现有输入安全组
  10. 频道
  11. 带有媒体包 V2 的 Standard 频道
  12. 全局配置
  13. 文件位置
  14. 颜色校正
  15. 编码配置
  16. 视频
  17. 音频
  18. 说明
  19. 跨服务整合
  20. AWS 元素介质包 V2
  21. 高级
  22. 存档
  23. RTMP软件
  24. 特别审判庭
  25. AWS 元素介质连接路由器
  26. UDP 服务器
  27. 框架抓取
  28. 微软平滑流线
  29. 按输出的 HLS 设置
  30. 转发错误校正( UDP)
  31. MPEG-TS 容器设置
  32. 目标
  33. 其他目标
  34. 管道冗余
  35. 输入附件设置
  36. 自动输入失败
  37. Ad Avail 处理
  38. 自动创建的角色和赠款
  39. 带来你预定义的角色
  40. 云表计量
  41. 频道指标
  42. 媒体在任何地方
  43. 网络
  44. 组
  45. 频道定位组
  46. SDI 来源
  47. 前提输入网络

AWS: 媒介构造库


cdk-constructs: Experimental

本单元中更高层次的构件的API是实验性的并正在积极开发中. 在今后任何版本中,它们都须作非背向相容的修改或去除。 这些是 不适用 语义版本 模型和断开的更改 在发行笔记中宣布. 这意味着虽然你可能使用它们,但可能需要更新 当更新到此软件包的更新版本时,您的源代码.


AWS 元素介质Live

AWS Elemental MediaLive是一种实时视频服务,可以让您为广播和流播制作现场节目.

这个软件包包含与 AWS Elemental MediaLive 合作的构造,包括输入,输入安全组,频道,以及MediaLive Where资源(网络,集群,频道定位组,SDI源).

关于AWS元素介质Live的进一步信息,参见: 文件。见 每个输出组中支持的代码。 。 。 .

以下示例创建了 SRT 调用器输入,将其编码为 H.264 + AAC,并将 HLS 段输出为 S3 桶 :

declare const stack: Stack;
declare const bucket: s3.IBucket;

const input = new medialive.Input(stack, 'SrtInput', {
  inputName: 'my-srt-input',
  input: medialive.InputConfiguration.srtCaller([{
    srtListenerAddress: '203.0.113.10',
    srtListenerPort: 5000,
  }]),
});

const video = medialive.EncodeConfiguration.video({
  name: 'video_720p',
  codec: medialive.VideoCodecSettings.h264({
    rateControl: medialive.H264RateControl.cbr({ bitrate: Bitrate.mbps(3) }),
    framerate: medialive.Framerate.FPS_30,
  }),
  width: 1280,
  height: 720,
});

const audio = medialive.EncodeConfiguration.audio({
  name: 'audio_aac',
  codec: medialive.AudioCodecSettings.aac({ bitrate: Bitrate.kbps(192) }),
});

new medialive.Channel(stack, 'Channel', {
  inputs: [{ input }],
  outputGroups: [
    medialive.OutputGroupConfiguration.hls({
      name: 'hls',
      destinations: [medialive.OutputDestination.toBucket(bucket, 'live/stream')],
      outputs: [{ encodes: [video, audio], outputName: 'hls_out' }],
    }),
  ],
});

投入

一个输入代表一个MediaLive信道的上游来源。 使用 InputConfiguration 制造不同输入类型的工厂方法.

SRT 呼叫器

MediaLive 连接到远程 SRT 听器 :

declare const stack: Stack;
new medialive.Input(stack, 'SrtInput', {
  inputName: 'srt-caller',
  input: medialive.InputConfiguration.srtCaller([{
    srtListenerAddress: '203.0.113.10',
    srtListenerPort: 5000,
  }]),
});

SRT 监听器

MediaLive 为即将到来的SRT连接收听. SRT 听器输入需要输入安全 组合。 要接收加密内容,请提供 a decryption 块引用密件管理器 秘密,持有密码句——秘密通过参考传递,所以MediaLive解决了ARN 合成时间 :

declare const stack: Stack;
declare const passphrase: secretsmanager.ISecret;

const sg = new medialive.InputSecurityGroup(stack, 'SrtSg', {
  allowlistRules: ['203.0.113.0/24'],
});

new medialive.Input(stack, 'SrtListenerInput', {
  inputName: 'srt-listener',
  input: medialive.InputConfiguration.srtListener({
    inputSecurityGroups: [sg],
    minimumLatency: Duration.millis(500),
    streamId: 'my-stream-id',
    decryption: {
      algorithm: medialive.SrtDecryptionAlgorithm.AES256,
      passphraseSecret: passphrase,
    },
  }),
});

AWS 元素介质连接路由器

创建自动加密的MediaConnect路由器输入 :

declare const stack: Stack;
new medialive.Input(stack, 'RouterInput', {
  inputName: 'mc-router',
  input: medialive.InputConfiguration.mediaConnectRouter(),
});

仅此一种输入 @aws-cdk/aws-mediaconnect-alpha是因为 RouterOutputConfiguration.mediaLiveInput() 可以交付——将其指向任何其他输入类型合成,但在部署时失败.

来自 S3 的 MP4 文件

使用 InputSource.fromBucket() 引用 S3 对象 :

declare const stack: Stack;
declare const bucket: s3.IBucket;

new medialive.Input(stack, 'FileInput', {
  inputName: 'mp4-file',
  input: medialive.InputConfiguration.mp4File([
    medialive.InputSource.fromBucket(bucket, 'media/input.mp4'),
  ]),
});

导入已有输入

declare const stack: Stack;
const input = medialive.Input.fromInputArn(stack, 'Imported',
  'arn:aws:medialive:us-east-1:123456789012:input:1234567');

输入安全组

一个输入安全组控制器,IPv4 CIDR块可以将内容推向推出类型的输入.

declare const stack: Stack;
const sg = new medialive.InputSecurityGroup(stack, 'SG', {
  allowlistRules: ['203.0.113.0/24'],
});

导入现有输入安全组

declare const stack: Stack;
const sg = medialive.InputSecurityGroup.fromInputSecurityGroupArn(stack, 'Imported',
  'arn:aws:medialive:us-east-1:123456789012:inputSecurityGroup:1234567');

频道

一个信道取出一个或多个输入,编码它们,并产生输出组. 若无 role 提供,频道自动创建 IAM 角色与 medialive.amazonaws.com 服务校长.

最小的例子——单输入,单HLS输出:

declare const stack: Stack;
declare const input: medialive.IInput;
declare const bucket: s3.IBucket;

const video = medialive.EncodeConfiguration.video({
  name: 'video_720p',
  codec: medialive.VideoCodecSettings.h264({
    rateControl: medialive.H264RateControl.cbr({ bitrate: Bitrate.mbps(3) }),
    framerate: medialive.Framerate.FPS_30,
  }),
  width: 1280,
  height: 720,
});

const audio = medialive.EncodeConfiguration.audio({
  name: 'audio_aac',
  codec: medialive.AudioCodecSettings.aac({ bitrate: Bitrate.kbps(192) }),
});

new medialive.Channel(stack, 'Channel', {
  inputs: [{ input }],
  outputGroups: [
    medialive.OutputGroupConfiguration.hls({
      name: 'hls',
      destinations: [medialive.OutputDestination.toBucket(bucket, 'live/stream')],
      outputs: [{ encodes: [video, audio], outputName: 'hls_out' }],
    }),
  ],
});

带有媒体包 V2 的 Standard 频道

一个标准达道运行两条管道进行冗余. 每个产出组需要两个目的地——每个管道一个.

declare const stack: Stack;
declare const input: medialive.IInput;
declare const mpChannel: mediapackagev2.IChannel;

const hdVideo = medialive.EncodeConfiguration.video({
  name: 'video_1080p',
  codec: medialive.VideoCodecSettings.h265({
    rateControl: medialive.H265RateControl.qvbr({
      maxBitrate: Bitrate.mbps(8),
      qvbrQualityLevel: 7,
    }),
    framerate: medialive.Framerate.FPS_30,
  }),
  width: 1920,
  height: 1080,
});

const sdVideo = medialive.EncodeConfiguration.video({
  name: 'video_480p',
  codec: medialive.VideoCodecSettings.h265({
    rateControl: medialive.H265RateControl.qvbr({
      maxBitrate: Bitrate.mbps(2),
      qvbrQualityLevel: 7,
    }),
    framerate: medialive.Framerate.FPS_30,
  }),
  width: 854,
  height: 480,
});

const audio = medialive.EncodeConfiguration.audio({
  name: 'audio_aac',
  codec: medialive.AudioCodecSettings.aac({ bitrate: Bitrate.kbps(192) }),
});

new medialive.Channel(stack, 'Channel', {
  channelClass: medialive.ChannelClass.STANDARD,
  inputs: [{ input }],
  outputGroups: [
    medialive.OutputGroupConfiguration.mediaPackageV2({
      name: 'emp',
      channel: mpChannel,
      outputs: [
        { encode: hdVideo, outputName: 'hd' },
        { encode: sdVideo, outputName: 'sd' },
        { encode: audio, outputName: 'audio' },
      ],
    }),
  ],
});

全局配置

globalConfiguration 设置全通道行为:管道如何被锁定在一起以及输出时间源。 所有字段都是可选的并倒回MediaLive默认.

declare const stack: Stack;
declare const input: medialive.IInput;
declare const bucket: s3.IBucket;
declare const video: medialive.EncodeConfiguration;
declare const audio: medialive.EncodeConfiguration;

new medialive.Channel(stack, 'Channel', {
  inputs: [{ input }],
  timecodeConfig: {
    source: medialive.TimecodeSource.EMBEDDED,
  },
  globalConfiguration: {
    outputLocking: medialive.OutputLocking.epoch(),
    outputTimingSource: medialive.OutputTimingSource.INPUT_CLOCK,
  },
  outputGroups: [
    medialive.OutputGroupConfiguration.hls({
      name: 'hls',
      destinations: [medialive.OutputDestination.toBucket(bucket, 'live/stream')],
      outputs: [{ encodes: [video, audio], outputName: 'hls_out' }],
    }),
  ],
});

输出锁定

outputLocking 同步一个频道的两条管道发射的帧. 选择一个策略 页:1 OutputLocking 工厂:

  • OutputLocking.pipeline() ——使每条管线的输出互相同步. 选择如何使用 method数字 : PipelineLockingMethod.SOURCE_TIMECODE (默认,需要可靠的嵌入式时间码)或 PipelineLockingMethod.VIDEO_ALIGNMENT (视频内容匹配,不需要时间码).
  • OutputLocking.epoch() ——与 Unix 时代同步(可选 a) customEpoch编号 :jamSyncTime) (中文(简体) ). 要求数 outputTimingSource: OutputTimingSource.INPUT_CLOCK (在合成时强制).
  • OutputLocking.disabled() ——不同步.
// Video-aligned pipeline locking — useful when sources lack reliable timecodes
const locking = medialive.OutputLocking.pipeline({
  method: medialive.PipelineLockingMethod.VIDEO_ALIGNMENT,
});

输入- 丢失行为

inputLossBehavior 当输入丢失时, 控制 MediaLive 释放出什么: 一个黑色的周期, 然后是一个 重复相框,然后是坚实的颜色或平板图像。 提供清单为 FileLocation。 。 。 .

declare const slateBucket: s3.IBucket;

const inputLoss: medialive.InputLossBehavior = {
  blackFrame: Duration.seconds(1),
  repeatFrame: Duration.seconds(5),
  imageType: medialive.InputLossImageType.SLATE,
  imageSlate: medialive.FileLocation.fromBucket(slateBucket, 'slates/offline.png'),
};

文件位置

多个频道的功能是参考一个文件MediaLive在运行时读取的——一个输入-丢失列表,一个 显示效果的图像、 断电的平板图像, 或刻录的字幕字体 。 这些都是一个 FileLocation,从 S3 桶(自动授予频道角色读取权限)或 URL 创建 (带有可选的SSM支持的证书):

import { StringParameter } from 'aws-cdk-lib/aws-ssm';

declare const bucket: s3.IBucket;
declare const passwordParam: StringParameter;

// From an S3 bucket — the channel role is granted read access automatically
const fromS3 = medialive.FileLocation.fromBucket(bucket, 'assets/slate.png');

// From a URL with optional credentials (SSM parameter read access auto-granted)
const fromUrl = medialive.FileLocation.url('https://origin.example.com/font.ttf', {
  username: 'ingest-user',
  password: passwordParam,
});

颜色校正

频道可以对其视频应用一个或多个色彩空间转换,可选使用3D LUT 重新绘制颜色。 每个 ColorCorrection 声明 inputColorSpace 来匹配和 outputColorSpace 转换为。 MediaLive在运行时从S3读取LUT,所以必须是S3 地点——通过 Lut.fromBucket() (使用安全设备) s3ssl:// 表格和自动赠款 频道角色读取访问)或 Lut.url() 带有 s3://编号 :s3ssl:// URL :

declare const stack: Stack;
declare const bucket: s3.IBucket;
declare const input: medialive.IInput;
declare const video: medialive.EncodeConfiguration;
declare const destination: medialive.OutputDestination;

new medialive.Channel(stack, 'Channel', {
  inputs: [{ input }],
  colorCorrections: [{
    inputColorSpace: medialive.ColorSpace.REC_601,
    outputColorSpace: medialive.ColorSpace.REC_709,
    lut: medialive.Lut.fromBucket(bucket, 'luts/rec601-to-rec709.cube'),
  }],
  outputGroups: [
    medialive.OutputGroupConfiguration.hls({
      name: 'hls',
      destinations: [destination],
      outputs: [{ encodes: [video], outputName: 'video' }],
    }),
  ],
});

编码配置

使用 EncodeConfiguration.video(), (中文(简体) ), EncodeConfiguration.audio(),以及 EncodeConfiguration.caption() 定义编码.

视频

// H.264
const h264 = medialive.EncodeConfiguration.video({
  name: 'h264_720p',
  codec: medialive.VideoCodecSettings.h264({
    rateControl: medialive.H264RateControl.cbr({ bitrate: Bitrate.mbps(3) }),
    framerate: medialive.Framerate.FPS_30,
    profile: medialive.H264Profile.HIGH,
  }),
  width: 1280,
  height: 720,
});

// H.265
const h265 = medialive.EncodeConfiguration.video({
  name: 'h265_1080p',
  codec: medialive.VideoCodecSettings.h265({
    rateControl: medialive.H265RateControl.qvbr({
      maxBitrate: Bitrate.mbps(5),
      qvbrQualityLevel: 7,
    }),
    framerate: medialive.Framerate.FPS_30,
    profile: medialive.H265Profile.MAIN,
    tier: medialive.H265Tier.HIGH,
  }),
  width: 1920,
  height: 1080,
});

视频解码器接受可选的覆盖,用于适应性量化,场景变化检测,色彩空间等. 参见完整列表的道具接口 :

const hdr = medialive.EncodeConfiguration.video({
  name: 'h265_hdr',
  codec: medialive.VideoCodecSettings.h265({
    rateControl: medialive.H265RateControl.qvbr({ maxBitrate: Bitrate.mbps(8), qvbrQualityLevel: 8 }),
    framerate: medialive.Framerate.FPS_30,
    sceneChangeDetect: medialive.H265SceneChangeDetect.ENABLED,
    colorSpaceSettings: medialive.H265ColorSpaceSettings.hlg2020(),
  }),
  width: 1920,
  height: 1080,
});

音频

// AAC stereo
const aac = medialive.EncodeConfiguration.audio({
  name: 'aac_stereo',
  codec: medialive.AudioCodecSettings.aac({
    bitrate: Bitrate.kbps(192),
    codingMode: medialive.AacCodingMode.CODING_MODE_2_0,
  }),
});

// AC3 5.1
const ac3 = medialive.EncodeConfiguration.audio({
  name: 'ac3_surround',
  codec: medialive.AudioCodecSettings.ac3({
    bitrate: Bitrate.kbps(384),
    codingMode: medialive.Ac3CodingMode.CODING_MODE_3_2_LFE,
  }),
});

说明

标题编码转换源标题音轨( 引用于 captionSelectorName改为: 输入格式 CaptionDestination 工厂。 一个选择器可以提供多个编码 :

// Define a caption selector on the input attachment (see Input Attachment Settings below)
const captionSelector = medialive.CaptionSelector.embedded('captions');

// WebVTT captions — packaged alongside the video encode in the same output
const webvtt = medialive.EncodeConfiguration.caption({
  name: 'eng_webvtt',
  captionSelectorName: captionSelector.name,
  languageCode: 'eng',
  languageDescription: 'English',
  destination: medialive.CaptionDestination.webvtt(),
});

// Burned-in captions — rendered into the video, styled via the burn-in options
const burnIn = medialive.EncodeConfiguration.caption({
  name: 'eng_burnin',
  captionSelectorName: captionSelector.name,
  destination: medialive.CaptionDestination.burnIn({
    alignment: medialive.CaptionAlignment.CENTERED,
    fontColor: medialive.CaptionFontColor.WHITE,
    outlineColor: medialive.CaptionOutlineColor.BLACK,
    fontSize: medialive.CaptionFontSize.AUTO,
  }),
});

跨服务整合

目标媒体侧面另一边软件包
媒体包 V2medialive.OutputGroupConfiguration.mediaPackageV2()mediapackagev2.Channel@aws-cdk/aws-mediapackagev2-alpha
媒体连接路由器( 输出)medialive.OutputGroupConfiguration.mediaConnectRouter()mediaconnect.RouterInputConfiguration.mediaLiveChannel()@aws-cdk/aws-mediaconnect-alpha
MediaConnect路由器(输入)medialive.InputConfiguration.mediaConnectRouter()mediaconnect.RouterOutputConfiguration.mediaLiveInput()@aws-cdk/aws-mediaconnect-alpha

AWS 元素介质包 V2

使用 mediaPackageV2() 和通过一个单 channel —— MediaLive 将每个管道自动映射到一个 MediaPackage 摄入端点(一个用于 SINGLE_PIPELINE,两者都用于 STANDARD) (中文(简体) ). 每个输出包含一个单一的编码(每个输出一个音轨).

带内字幕(烧入、嵌入)与视频编码一起通过 captions 道具 :

declare const mpChannel: mediapackagev2.IChannel;
declare const hdVideo: medialive.EncodeConfiguration;
declare const sdVideo: medialive.EncodeConfiguration;
declare const audio: medialive.EncodeConfiguration;
declare const burnIn: medialive.EncodeConfiguration;

medialive.OutputGroupConfiguration.mediaPackageV2({
  name: 'emp',
  channel: mpChannel,
  outputs: [
    { encode: hdVideo, captions: [burnIn], outputName: 'hd' },
    { encode: sdVideo, outputName: 'sd' },
    { encode: audio, outputName: 'audio' },
  ],
});

每条管线的控制——例如将管线0钉入特定终点,或将每条管线输送到不同的(跨区域)通道——使用 mediaPackageV2PerPipeline() 明确目的地:

declare const primary: mediapackagev2.IChannel;
declare const hdVideo: medialive.EncodeConfiguration;

medialive.OutputGroupConfiguration.mediaPackageV2PerPipeline({
  name: 'emp',
  destinations: [
    // destinations[0] → Pipeline 0, destinations[1] → Pipeline 1
    medialive.MediaPackageV2Destination.channel(primary, medialive.MediaPackageV2EndpointId.ENDPOINT_2),
    medialive.MediaPackageV2Destination.channel(primary, medialive.MediaPackageV2EndpointId.ENDPOINT_1),
  ],
  outputs: [
    { encode: hdVideo, outputName: 'hd' },
  ],
});

高级

使用 OutputDestination.url() hTTP 源代码或 OutputDestination.toBucket() 关于S3:

declare const bucket: s3.IBucket;
declare const video: medialive.EncodeConfiguration;
declare const audio: medialive.EncodeConfiguration;

// HLS to S3
medialive.OutputGroupConfiguration.hls({
  name: 'hls_s3',
  destinations: [medialive.OutputDestination.toBucket(bucket, 'live/stream')],
  outputs: [{ encodes: [video, audio], outputName: 'hls_out' }],
});

// HLS to an HTTPS CDN origin.
medialive.OutputGroupConfiguration.hls({
  name: 'hls-http',
  destinations: [medialive.OutputDestination.url('https://203.0.113.10/ingest/stream')],
  hlsCdnSettings: medialive.HlsCdnSettings.basicPut(),
  outputs: [{ encodes: [video, audio], outputName: 'hls_out' }],
});

存档

归档输出将长式录音写入 S3 :

declare const bucket: s3.IBucket;
declare const video: medialive.EncodeConfiguration;
declare const audio: medialive.EncodeConfiguration;

medialive.OutputGroupConfiguration.archive({
  name: 'archive',
  destinations: [medialive.S3OutputDestination.toBucket(bucket, 'archive/recording')],
  rolloverInterval: Duration.seconds(600),
  outputs: [{ encodes: [video, audio], outputName: 'archive_out' }],
});

RTMP软件

RTMP的产出只支持H.264 + AAC. 每个输出每个信道管道(控制台的"Destination A"/"Destination B")需要1个目的地 RtmpDestination.url() - 一个给 SINGLE_PIPELINE,两个用于 STANDARD数字 :

declare const video: medialive.EncodeConfiguration;
declare const audio: medialive.EncodeConfiguration;

medialive.OutputGroupConfiguration.rtmp({
  name: 'social',
  outputs: [{
    encodes: [video, audio],
    outputName: 'live',
    destinations: [
      medialive.RtmpDestination.url('rtmp://rtmp.example.com/live', 'your-stream-key'),
    ],
  }],
});

特别审判庭

SRT产出的使用 SrtDestination.caller() 用于呼叫模式或 SrtDestination.listener() 用于听众模式。 当您已经拥有完整的 SRT URL 而不是单独的主机和端口时,请使用 SrtDestination.callerUrl(). SRT 输出总是加密的,所以每个目的地都需要一个 encryptionPassphraseSecret (一个保密经理的秘密). 每种产出每个信道管道(“A”/“B”)需要一个目的地——一个用于 SINGLE_PIPELINE,两个用于 STANDARD数字 :

declare const video: medialive.EncodeConfiguration;
declare const audio: medialive.EncodeConfiguration;
declare const passphrase: secretsmanager.ISecret;

// SRT caller to a remote listener
medialive.OutputGroupConfiguration.srt({
  name: 'srt_out',
  outputs: [{
    encodes: [video, audio],
    outputName: 'srt_caller',
    destinations: [medialive.SrtDestination.caller({
      address: '203.0.113.20',
      port: 5000,
      encryptionPassphraseSecret: passphrase,
    })],
  }],
});

// SRT listener — MediaLive waits for the downstream system to connect
medialive.OutputGroupConfiguration.srt({
  name: 'srt_listen',
  outputs: [{
    encodes: [video, audio],
    outputName: 'srt_listener',
    destinations: [medialive.SrtDestination.listener({
      listenerPort: 5000,
      encryptionPassphraseSecret: passphrase,
    })],
  }],
});

AWS 元素介质连接路由器

mediaConnectRouter() 将每个信道管道发送到 AWS Elemental MediaConnect 路由器。 转运加密默认到AUTOMATIC;CDK从信道类中每个管线产生一个去向,因此常见的情况不需要每个管线配置. 您必须指定 availabilityZones - 一个是 SINGLE_PIPELINE 通道,或两个(每个管道一个)用于 STANDARD下游接线——每条输入输油管的路由器输入输油管的输油管——是在MediaConnect一侧配置的,以名称和输油管编号来参考这一组的产出.

declare const video: medialive.EncodeConfiguration;
declare const audio: medialive.EncodeConfiguration;
declare const passphrase: secretsmanager.ISecret;
declare const passphrase1: secretsmanager.ISecret;

// AUTOMATIC encryption on every pipeline (MPEG-TS container, like UDP)
medialive.OutputGroupConfiguration.mediaConnectRouter({
  name: 'router_out',
  availabilityZones: ['us-east-1a'],
  outputs: [{ encodes: [video, audio], outputName: 'router_ts' }],
});

// One shared Secrets Manager passphrase across all pipelines (SECRETS_MANAGER encryption)
medialive.OutputGroupConfiguration.mediaConnectRouter({
  name: 'router_out',
  availabilityZones: ['us-east-1a'],
  routerSettings: medialive.MediaConnectRouterSettings.shared({ encryptionSecret: passphrase }),
  outputs: [{ encodes: [video, audio], outputName: 'router_ts' }],
});

// Distinct encryption per pipeline — an omitted pipeline stays AUTOMATIC (STANDARD channels)
medialive.OutputGroupConfiguration.mediaConnectRouter({
  name: 'router_out',
  availabilityZones: ['us-east-1a', 'us-east-1b'],
  routerSettings: medialive.MediaConnectRouterSettings.perPipeline({
    pipeline1: { encryptionSecret: passphrase1 },
  }),
  outputs: [{ encodes: [video, audio], outputName: 'router_ts' }],
});

当提供密码口令密语时,该频道的IAM角色会自动获得读取权限.

UDP 服务器

UDP输出通过UDP或RTP提供MPEG-TS. 使用 UdpOutputDestination.udp() 用于纯 UDP 或 .rtp() 用于RTP(如果使用FEC需要):

declare const video: medialive.EncodeConfiguration;
declare const audio: medialive.EncodeConfiguration;

medialive.OutputGroupConfiguration.udp({
  name: 'udp_out',
  destinations: [medialive.UdpOutputDestination.udp({ address: '203.0.113.5', port: 5000 })],
  outputs: [{ encodes: [video, audio], outputName: 'ts_out' }],
});

框架抓取

框架抓取输出将周期 JPEG 快照写入 S3 :

declare const bucket: s3.IBucket;
declare const video: medialive.EncodeConfiguration;

medialive.OutputGroupConfiguration.frameCapture({
  name: 'thumbnails',
  destinations: [medialive.S3OutputDestination.toBucket(bucket, 'thumbnails/live')],
  outputs: [{ encodes: [video], outputName: 'thumb' }],
});

微软平滑流线

MS平滑输出将零碎的MP4推向IIS平滑流端:

declare const video: medialive.EncodeConfiguration;
declare const audio: medialive.EncodeConfiguration;

medialive.OutputGroupConfiguration.msSmooth({
  name: 'smooth',
  destinations: [medialive.OutputDestination.url('https://smooth.example.com/live')],
  outputs: [{ encodes: [video, audio], outputName: 'smooth_out' }],
});

按输出的 HLS 设置

HLS 输出接受每个输出 hlsSettings 通过 HlsSettings 工厂 - standard() 视频 引渡(可选) M3u8Settings 用于运输, audioOnly() 音频 引渡(可选的涵盖条款作为 FileLocation, (中文(简体) ), fmp4(),或 frameCapture()。 。 。 .

declare const bucket: s3.IBucket;
declare const video: medialive.EncodeConfiguration;
declare const audio: medialive.EncodeConfiguration;

medialive.OutputGroupConfiguration.hls({
  name: 'hls',
  destinations: [medialive.OutputDestination.toBucket(bucket, 'live/stream')],
  outputs: [
    {
      encodes: [video],
      outputName: 'video',
      hlsSettings: medialive.HlsSettings.standard({
        m3u8Settings: medialive.M3u8Settings.of({
          scte35Behavior: medialive.M3u8Scte35Behavior.PASSTHROUGH,
          programNum: 1,
        }),
      }),
    },
    {
      encodes: [audio],
      outputName: 'audio',
      hlsSettings: medialive.HlsSettings.audioOnly({
        audioGroupId: 'program',
        audioOnlyImage: medialive.FileLocation.fromBucket(bucket, 'art/cover.png'),
      }),
    },
  ],
});

转发错误校正( UDP)

UDP 输出接受可选 fec 设置(SMPTE 2022-1) – 只列或列并列 FEC. FEC 需要一个 rtp:// 目标 :

declare const video: medialive.EncodeConfiguration;

medialive.OutputGroupConfiguration.udp({
  name: 'udp',
  destinations: [medialive.UdpOutputDestination.rtp({ address: '203.0.113.5', port: 5000 })],
  outputs: [{
    encodes: [video],
    outputName: 'ts',
    fec: { mode: medialive.FecMode.COLUMN_AND_ROW, columnDepth: 10, rowLength: 10 },
  }],
});

MPEG-TS 容器设置

MPEG-TS 输出组 - udp(), (中文(简体) ), archive(), (中文(简体) ), srt(),以及 mediaConnectRouter() ——接受可选产出 m2tsSettings 通过 M2tsSettings.of(). 启用它来使用 MediaLive 的服务默认值. 使用比特率 Bitrate,间隔使用 Duration,而闭合值字段使用enum(例如. M2tsRateMode, (中文(简体) ), M2tsScte35Control); PID 字段是接受十进制,十六进制,范围,或逗号分隔列表的字符串.

declare const video: medialive.EncodeConfiguration;
declare const audio: medialive.EncodeConfiguration;

medialive.OutputGroupConfiguration.udp({
  name: 'udp_out',
  destinations: [medialive.UdpOutputDestination.udp({ address: '203.0.113.5', port: 5000 })],
  outputs: [{
    encodes: [video, audio],
    outputName: 'ts',
    m2tsSettings: medialive.M2tsSettings.of({
      bitrate: Bitrate.mbps(8),
      rateMode: medialive.M2tsRateMode.VBR,
      programNum: 1,
      patInterval: Duration.millis(100),
      pmtInterval: Duration.millis(100),
      scte35Control: medialive.M2tsScte35Control.PASSTHROUGH,
      dvbSdtSettings: {
        outputSdt: medialive.DvbSdtOutputMode.SDT_MANUAL,
        serviceName: 'My Service',
        repInterval: Duration.millis(2000),
      },
    }),
  }],
});

目标

每个输出组类型都使用特定的目的地类. 通过静态工厂方法创建目的地:

目标类工厂方法用于
OutputDestinationurl(), (中文(简体) ), toBucket()HLS, MS平滑, CMAF 错误
S3OutputDestinationurl(), (中文(简体) ), toBucket()存档, 框架抓取
UdpOutputDestinationudp(), (中文(简体) ), rtp(), (中文(简体) ), url()UDP 服务器
MediaPackageV2Destinationchannel()媒体包 V2
RtmpDestinationurl()RTMP软件
SrtDestinationcaller(), (中文(简体) ), callerUrl(), (中文(简体) ), listener()特别审判庭

OutputDestination.toBucket() (和 S3OutputDestination.toBucket()) 建造峡谷 s3ssl:// URL和自动授予频道的IAM角色所需的S3权限; InputSource.fromBucket() 输入读取时使用相同的输入. MediaPackageV2Destination.channel() 自动授予 MediaPackage V2 频道的摄入权限.

MediaConnect路由器输出组没有目的类——其发送被配置在MediaConnect一侧. 每条管道中转加密通过组设置 routerSettings 使用道具 MediaConnectRouterSettings.shared() 编号 : .perPipeline() (见 媒体连接路由器 (见上文).

其他目标

媒体包V2和CMAF 支持的有限产出组 additionalDestinations 用于跨区域交付或备份包装。 它们是与管道冗余分开的——它们把相同的内容传出额外的终点.

每个目的地的区域自动从频道的堆栈中解决. 就跨区域的进口而言,明确通过本区域:

declare const primaryChannel: mediapackagev2.IChannel;
declare const video: medialive.EncodeConfiguration;
declare const audio: medialive.EncodeConfiguration;

// Import a channel from another region — the region travels with the channel
const backupChannel = mediapackagev2.Channel.fromChannelAttributes(this, 'BackupChannel', {
  channelName: 'backup-channel',
  channelGroupName: 'backup-group',
  region: 'us-west-2',
});

medialive.OutputGroupConfiguration.mediaPackageV2({
  name: 'emp',
  channel: primaryChannel,
  additionalDestinations: [
    // Cross-region: the destination picks up us-west-2 from the imported channel
    medialive.MediaPackageV2Destination.channel(backupChannel, medialive.MediaPackageV2EndpointId.ENDPOINT_1),
  ],
  outputs: [
    { encode: video, outputName: 'video' },
    { encode: audio, outputName: 'audio' },
  ],
});

管道冗余

频道默认为 SINGLE_PIPELINE设置 channelClass: ChannelClass.STANDARD 双管冗余.

当使用标准:

  • 每个输出组 destinations 数组必须有两个条目—— destinations[0] 地图到管道 0, destinations[1] 地图到管道 1.
  • 对于MediaPackage V2, 使用 ENDPOINT_1 管道 0 和 ENDPOINT_2 1号管道.
  • additionalDestinations 与管道冗余分开——它们向外延伸到额外的终点.
declare const stack: Stack;
declare const input: medialive.IInput;
declare const bucket: s3.IBucket;
declare const video: medialive.EncodeConfiguration;
declare const audio: medialive.EncodeConfiguration;

new medialive.Channel(stack, 'StandardChannel', {
  channelClass: medialive.ChannelClass.STANDARD,
  inputs: [{ input }],
  outputGroups: [
    medialive.OutputGroupConfiguration.hls({
      name: 'hls',
      destinations: [
        medialive.OutputDestination.toBucket(bucket, 'live/pipeline0'),
        medialive.OutputDestination.toBucket(bucket, 'live/pipeline1'),
      ],
      outputs: [{ encodes: [video, audio], outputName: 'hls_out' }],
    }),
  ],
});

输入附件设置

每个条目 inputs 是一个输入附件,它可以携带每输入提取和连接 输入本身以外的设置.

选择器 从输入中选择特定的音轨。 使用 AudioSelector (单位:千美元)byLanguage(), (中文(简体) ), byPid(), (中文(简体) ), byTrack(), (中文(简体) ), hlsRendition(), (中文(简体) ), default(), (中文(简体) ), CaptionSelector (单位:千美元)byLanguage(), (中文(简体) ), embedded(), (中文(简体) ), ancillary(), (中文(简体) ), dvbSub(), (中文(简体) ), scte27(), (中文(简体) ), teletext(), (中文(简体) ), arib()),以及 videoSelector (颜色空间, HDR10 元数据和通过 VideoSelection) (中文(简体) ). 标题编码后引用 a 标题选择器的名称 .

declare const stack: Stack;
declare const input: medialive.IInput;
declare const bucket: s3.IBucket;
declare const video: medialive.EncodeConfiguration;

new medialive.Channel(stack, 'Channel', {
  inputs: [{
    input,
    audioSelectors: [
      medialive.AudioSelector.byLanguage('eng', 'eng', medialive.AudioLanguageSelectionPolicy.STRICT),
    ],
    captionSelectors: [
      medialive.CaptionSelector.embedded('embedded'),
    ],
    videoSelector: {
      colorSpace: medialive.VideoColorSpace.HDR10,
      colorSpaceUsage: medialive.VideoColorSpaceUsage.FORCE,
      selectBy: medialive.VideoSelection.byProgramId(1),
    },
  }],
  outputGroups: [
    medialive.OutputGroupConfiguration.hls({
      name: 'hls',
      destinations: [medialive.OutputDestination.toBucket(bucket, 'live/stream')],
      outputs: [{ encodes: [video], outputName: 'hls_out' }],
    }),
  ],
});

网络输入设置 适用于 URL- pull 和多播输入 — HLS 带宽/缓冲/ 重试 行为,SCTE-35来源HlsScte35Source.SEGMENTS 或者说 MANIFEST),HTTPS服务器验证, 和用于源特定多播的多播源IP. logicalInterfaceNames 映射输入到 mediaLive Anywhere节点上的网络接口.

declare const stack: Stack;
declare const input: medialive.IInput;
declare const bucket: s3.IBucket;
declare const video: medialive.EncodeConfiguration;

new medialive.Channel(stack, 'Channel', {
  inputs: [{
    input,
    networkInputSettings: {
      serverValidation: medialive.ServerValidation.CHECK_CRYPTOGRAPHY_AND_VALIDATE_NAME,
      hlsInputSettings: {
        bandwidth: Bitrate.mbps(5),
        scte35Source: medialive.HlsScte35Source.MANIFEST,
      },
    },
    logicalInterfaceNames: ['eth0', 'eth1'],
  }],
  outputGroups: [
    medialive.OutputGroupConfiguration.hls({
      name: 'hls',
      destinations: [medialive.OutputDestination.toBucket(bucket, 'live/stream')],
      outputs: [{ encodes: [video], outputName: 'hls_out' }],
    }),
  ],
});

自动输入失败

自动输入失败给您输入 -来源 冗余: 附加二级输入,以及 MediaLive 当活动输入遇到故障时不重新启动频道切换到它 条件。 这与管道冗余无关 ChannelClass.STANDARD (哪个) 重复两个管道的单一来源.

提供 automaticInputFailover 输入附件。 如果你没有指定条件,a 使用单个输入- 丢失条件 :

declare const stack: Stack;
declare const primaryInput: medialive.IInput;
declare const secondaryInput: medialive.IInput;
declare const audioSelector: medialive.AudioSelector;
declare const video: medialive.EncodeConfiguration;
declare const audio: medialive.EncodeConfiguration;
declare const bucket: s3.IBucket;

new medialive.Channel(stack, 'Channel', {
  inputs: [{
    input: primaryInput,
    automaticInputFailover: {
      secondaryInput,
      inputPreference: medialive.InputPreference.PRIMARY_INPUT_PREFERRED,
      errorClearTime: Duration.seconds(3),
      failoverConditions: [
        medialive.FailoverCondition.inputLoss({ threshold: Duration.millis(1500) }),
        medialive.FailoverCondition.audioSilence({ audioSelector, threshold: Duration.seconds(2) }),
        medialive.FailoverCondition.videoBlack({ blackDetectThreshold: 0.1, threshold: Duration.seconds(1) }),
      ],
    },
  }, {
    // The secondary input must also be attached to the channel as its own input.
    input: secondaryInput,
  }],
  outputGroups: [
    medialive.OutputGroupConfiguration.hls({
      name: 'hls',
      destinations: [medialive.OutputDestination.toBucket(bucket, 'live/stream')],
      outputs: [{ encodes: [video, audio], outputName: 'hls_out' }],
    }),
  ],
});

初级和二级投入必须具有相同的投入类别。 该频道的IAM角色是 自动获得读取二次输入源,就像主输入一样.

Ad Avail 处理

MediaLive在广告使用时可以空出内容,插入停电板并信号SCTE-35广告使用 到下游系统。 这些都是频道级道具.

availBlanking 以黑色(或图像)取代广告使用时的视频/音频/封装 blackoutSlate 显示 SCTE- 35 断电时的列表 。 两个图像字段都使用 FileLocation。 。 。 .

declare const stack: Stack;
declare const input: medialive.IInput;
declare const bucket: s3.IBucket;
declare const video: medialive.EncodeConfiguration;

new medialive.Channel(stack, 'Channel', {
  inputs: [{ input }],
  availBlanking: {
    state: medialive.AvailBlankingState.ENABLED,
    image: medialive.FileLocation.fromBucket(bucket, 'slates/avail.png'),
  },
  blackoutSlate: {
    state: medialive.BlackoutSlateState.ENABLED,
    image: medialive.FileLocation.fromBucket(bucket, 'slates/blackout.png'),
  },
  outputGroups: [
    medialive.OutputGroupConfiguration.hls({
      name: 'hls',
      destinations: [medialive.OutputDestination.toBucket(bucket, 'live/stream')],
      outputs: [{ encodes: [video], outputName: 'hls_out' }],
    }),
  ],
});

availSettings 选择如何处理 SCTE- 35 广告效果 - AvailSettings.spliceInsert(), (中文(简体) ), AvailSettings.timeSignalApos(),或 AvailSettings.esam() 用于事件信号和管理 与外部 POIS 端点相对. scte35SegmentationScope 输出组收到的控件 分道扬镳 ESAM POIS 密码作为 SSM 参数提供,频道角色 可以自动读取.

import { StringParameter } from 'aws-cdk-lib/aws-ssm';

declare const stack: Stack;
declare const input: medialive.IInput;
declare const bucket: s3.IBucket;
declare const video: medialive.EncodeConfiguration;
declare const poisPassword: StringParameter;

new medialive.Channel(stack, 'Channel', {
  inputs: [{ input }],
  availSettings: medialive.AvailSettings.esam({
    pois: {
      url: 'https://pois.example.com/esam',
      username: 'pois-user',
      password: poisPassword,
    },
    acquisitionPointId: 'acquisition-point-1',
    adAvailOffset: Duration.millis(200),
  }),
  scte35SegmentationScope: medialive.Scte35SegmentationScope.SCTE35_ENABLED_OUTPUT_GROUPS,
  outputGroups: [
    medialive.OutputGroupConfiguration.hls({
      name: 'hls',
      destinations: [medialive.OutputDestination.toBucket(bucket, 'live/stream')],
      outputs: [{ encodes: [video], outputName: 'hls_out' }],
    }),
  ],
});

自动创建的角色和赠款

否时 role 提供,频道自动创建 IAM 角色与 medialive.amazonaws.com 服务本金并只授予您实际需要的配置权限。 这些自动赠款适用 仅限 到频道管理的角色; 如果您带来了自己的 role,没有添加.

频道角色补助金 ——基于您配置的线(仅由频道管理的角色) :

配置赠款范围
OutputDestination.toBucket()S3 读取/写入目的地桶/ 前缀
InputSource.fromBucket()S3 读取输入源桶/ 前缀
MediaPackageV2Destination.channel()mediapackagev2:PutObject媒体包 V2 频道
SrtDestination 带有加密密钥机密管理器已读取秘诀
URL 用密码参数拉入输入SSM 参数已读取参数
缩略图(默认情况下)s3:PutObject* 上传到AWS服务拥有的桶中
频道记录( U)logLevel 组)云表日志写入这个 ElementalMediaLive 账户/区域中的日志组
VPC 输出 (vpc 组)EC2 ENI 创建/删除+描述范围为您的子网/SG; Describe* 需求 *

投入角色赠款 ——与频道角色相分离,用于输入创建/删除时间. 和频道角色一样,这些只有在输入自动创建其角色时才会被添加; 通过 a role 改为 mediaConnect() 或者说 cdi() 并且不增加补助金:

输入类型赠款范围
InputConfiguration.mediaConnect()mediaconnect:ManagedDescribeFlow, (中文(简体) ), ManagedAddOutput, (中文(简体) ), ManagedRemoveOutput* 服务拒绝流动范围赠款
InputConfiguration.cdi()EC2 ENI 创建/删除+描述范围为您的子网/SG; Describe* 需求 *

渠道和输入自动创建的角色都包括相互混淆的预防(aws:SourceAccount + 键 aws:SourceArn (第6条)。 关于信任实体要求的全部清单,见 文件。 。 。 .

自动创建的角色可以在 channel.role 如果您需要添加更多权限.

带来你预定义的角色

当你通过一个 role,频道制作 没有 自动赠款——您需要添加角色所需的权限. 这既包括主要政策,也包括任何参考资源政策:S3输出目的地和输入源、秘密管理器和SSM读取、MediaPackage V2摄取、Cloud Watch Logs和VPC输出ENI管理。 见 信托实体要求,或通过账户 MediaLiveAccessRole ——MediaLive可以承担的IAM角色.

云表计量

频道显示在 AWS/MediaLive 名称空间, 以 ChannelId 财务报告和审定财务报表 Pipeline。将下面的指定助手用于最常用的衡量标准,或 metric(metricName, pipeline) ,以获取 媒体计量参考。 。 。 .

MediaLive每条管道公布衡量标准。 每个帮手都拿一个 Pipeline 所以你要明确决定 你所监视的输油管. STANDARD 频道运行两条冗余管道(PIPELINE_0, (中文(简体) ), PIPELINE_1) ——同时发出警报以覆盖整个频道. SINGLE_PIPELINE 频道只发布于 PIPELINE_0; 通过 PIPELINE_1 扔在合成时间.

declare const channel: medialive.Channel;
declare const stack: Stack;

channel.metricDroppedFrames(medialive.Pipeline.PIPELINE_0).createAlarm(stack, 'DroppedFrames', {
  threshold: 1,
  evaluationPeriods: 2,
});

channel.metricSvqTime(medialive.Pipeline.PIPELINE_0).createAlarm(stack, 'SvqTime', {
  threshold: 0,
  evaluationPeriods: 1,
});

// Custom metric by name with sum statistic
channel.metric('Output4xxErrors', medialive.Pipeline.PIPELINE_0, { statistic: 'sum' });

对于标准达道,警报 在两个管道:

declare const standardChannel: medialive.Channel;
declare const stack: Stack;

standardChannel.metricDroppedFrames(medialive.Pipeline.PIPELINE_0).createAlarm(stack, 'Drops0', {
  threshold: 1,
  evaluationPeriods: 2,
});
standardChannel.metricDroppedFrames(medialive.Pipeline.PIPELINE_1).createAlarm(stack, 'Drops1', {
  threshold: 1,
  evaluationPeriods: 2,
});

频道指标

帮助计量名称默认统计页:1
metricActiveAlerts(pipeline)ActiveAlerts马克斯频道中活动提醒总数
metricNetworkIn(pipeline)NetworkIn丑闻Mbps的入境交通
metricNetworkOut(pipeline)NetworkOut丑闻Mbps的出入境交通
metricInputVideoFrameRate(pipeline)InputVideoFrameRate马克斯源视频帧率
metricFillMsec(pipeline)FillMsec马克斯填充框架的时间——非零表示输入损失
metricInputLossSeconds(pipeline)InputLossSeconds总计没有包的秒数(RTP / MediaConnect 输入)
metricDroppedFrames(pipeline)DroppedFrames总计框因编码器后退而下降
metricSvqTime(pipeline)SvqTime马克斯减少质量以跟上
metric(name, pipeline, props?)(海关)(提供电话)构建任意度量 AWS/MediaLive

默认值与每个度量的 AWS 推荐统计值相匹配 。 过 props 覆盖统计、周期、维度或任何其他 MetricOptions 字段.

媒体在任何地方

媒体生活 任何地方都允许你运行 MediaLive 频道 在自己的前提硬件.

某些输入类型仅可用任意频道(频道配置为 anywhereSettings: SDI,SMPTE 2110接收器组,和多播. 试图在云道上使用这些输入类型,会在合成时抛出一个验证错误.

网络

一个网络定义了任何地方资源的IP地址池和路径:

declare const stack: Stack;
const network = new medialive.Network(stack, 'Network', {
  networkName: 'on-prem-network',
  ipPools: ['10.0.0.0/24'],
  routes: [{ cidr: '0.0.0.0/0', gateway: '10.0.0.1' }],
});

组

一组代表一组关于前提的硬件节点:

declare const stack: Stack;
declare const instanceRole: iam.IRole;

const cluster = new medialive.Cluster(stack, 'Cluster', {
  clusterName: 'on-prem-cluster',
  clusterType: medialive.ClusterType.ON_PREMISES,
  instanceRole,
});

频道定位组

一个频道放置组将频道分配到一个集群内的特定节点. 把它与一个频道通过 anywhereSettings数字 :

declare const stack: Stack;
declare const cluster: medialive.ICluster;
declare const input: medialive.IInput;
declare const video: medialive.EncodeConfiguration;
declare const bucket: s3.IBucket;

const cpg = new medialive.ChannelPlacementGroup(stack, 'CPG', {
  channelPlacementGroupName: 'my-cpg',
  cluster,
});

new medialive.Channel(stack, 'AnywhereChannel', {
  inputs: [{ input }],
  anywhereSettings: { cluster, channelPlacementGroup: cpg },
  outputGroups: [
    medialive.OutputGroupConfiguration.hls({
      name: 'hls',
      destinations: [medialive.OutputDestination.toBucket(bucket, 'live/stream')],
      outputs: [{ encodes: [video], outputName: 'hls_out' }],
    }),
  ],
});

SDI 来源

一个 SDI 源代表任何硬件上的物理 SDI 输入 :

declare const stack: Stack;
const sdi = new medialive.SdiSource(stack, 'Sdi', {
  sdiSourceName: 'camera-1',
  type: medialive.SdiType.SINGLE,
});

前提输入网络

对于生活在网络上的投入,设置 inputNetworkLocation 改为 InputNetworkLocation.ON_PREMISES中输入不使用输入安全组。 推开 输入(RTMP/RTP/UDP)可将其目的地定在 Network,宣布 networkRoutes 改为 访问本地网络,并请求 staticIpAddress数字 :

declare const stack: Stack;

const network = new medialive.Network(stack, 'Network', {
  networkName: 'on-prem-network',
  ipPools: ['192.168.1.0/24'],
});

new medialive.Input(stack, 'OnPremInput', {
  inputName: 'on-prem-rtp',
  inputNetworkLocation: medialive.InputNetworkLocation.ON_PREMISES,
  input: medialive.InputConfiguration.rtpPush({
    destinations: [{
      network,
      networkRoutes: [{ cidr: '10.0.0.0/24', gateway: '10.0.0.1' }],
      staticIpAddress: '192.168.1.50',
    }],
  }),
});

SRT 听器输入接受 a streamId 上游系统在连接时使用:

declare const stack: Stack;
declare const sg: medialive.IInputSecurityGroup;

new medialive.Input(stack, 'SrtListener', {
  inputName: 'srt-listener',
  input: medialive.InputConfiguration.srtListener({
    inputSecurityGroups: [sg],
    streamId: 'my-stream-id',
  }),
});

版本与发布记录

@aws-cdk/aws-medialive-alpha 共发布 8 个版本,首次发布于 2026/09/03;过去 12 个月发布了 8 个版本。

版本发布日期距今
2.275.0-alpha.0latest2026/10/2712 天前
2.274.0-alpha.02026/10/2018 天前
2.273.0-alpha.02026/10/0930 天前
2.272.0-alpha.02026/09/301 个月前
2.271.0-alpha.02026/09/261 个月前
2.270.0-alpha.02026/09/181 个月前

关于 @aws-cdk/aws-medialive-alpha 的常见问题

@aws-cdk/aws-medialive-alpha 是什么?

用于 MediaLive 的 CDK 构建库

如何安装 @aws-cdk/aws-medialive-alpha?

在项目目录运行 npm install @aws-cdk/aws-medialive-alpha,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:constructs(^10.5.0)、aws-cdk-lib(^2.275.0)、@aws-cdk/aws-mediapackagev2-alpha(^2.275.0-alpha.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@aws-cdk/aws-medialive-alpha 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@aws-cdk/aws-medialive-alpha 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@aws-cdk/aws-medialive-alpha 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >= 20.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@aws-cdk/aws-medialive-alpha 可以商用吗?

@aws-cdk/aws-medialive-alpha 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@aws-cdk/aws-medialive-alpha 的下载量有多少?

根据 npm 官方下载统计,@aws-cdk/aws-medialive-alpha 在 2026/10/08 – 2026/11/06 这 30 天内被下载 2,401 次,日均约 80 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aws-cdk/aws-medialive-alpha 还在维护吗?

最新版本 2.275.0-alpha.0 发布于 2026/10/27(12 天前);至今共发布 8 个版本,其中过去 12 个月发布了 8 个;首次发布于 2026/09/03。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。