Experimental
@aws-cdk/aws-medialive-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
Channel L2 construct
Defines an AWS Elemental MediaLive Channel.
Example
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' }],
}),
],
});
# stack: Stack
# input: medialive.IInput
# bucket: s3.IBucket
# video: medialive.EncodeConfiguration
medialive.Channel(stack, "Channel",
inputs=[medialive.InputAttachment(
input=input,
audio_selectors=[
medialive.AudioSelector.by_language("eng", "eng", medialive.AudioLanguageSelectionPolicy.STRICT)
],
caption_selectors=[
medialive.CaptionSelector.embedded("embedded")
],
video_selector=medialive.VideoSelectorSettings(
color_space=medialive.VideoColorSpace.HDR10,
color_space_usage=medialive.VideoColorSpaceUsage.FORCE,
select_by=medialive.VideoSelection.by_program_id(1)
)
)],
output_groups=[
medialive.OutputGroupConfiguration.hls(
name="hls",
destinations=[medialive.OutputDestination.to_bucket(bucket, "live/stream")],
outputs=[medialive.HlsOutputDefinition(encodes=[video], output_name="hls_out")]
)
]
)
Stack stack;
IInput input;
IBucket bucket;
EncodeConfiguration video;
Channel.Builder.create(stack, "Channel")
.inputs(List.of(InputAttachment.builder()
.input(input)
.audioSelectors(List.of(AudioSelector.byLanguage("eng", "eng", AudioLanguageSelectionPolicy.STRICT)))
.captionSelectors(List.of(CaptionSelector.embedded("embedded")))
.videoSelector(VideoSelectorSettings.builder()
.colorSpace(VideoColorSpace.HDR10)
.colorSpaceUsage(VideoColorSpaceUsage.FORCE)
.selectBy(VideoSelection.byProgramId(1))
.build())
.build()))
.outputGroups(List.of(OutputGroupConfiguration.hls(HlsOutputGroupProps.builder()
.name("hls")
.destinations(List.of(OutputDestination.toBucket(bucket, "live/stream")))
.outputs(List.of(HlsOutputDefinition.builder().encodes(List.of(video)).outputName("hls_out").build()))
.build())))
.build();
// Install: dotnet add package Amazon.CDK.AWS.MediaLive.Alpha
Stack stack;
IInput input;
IBucket bucket;
EncodeConfiguration video;
new Channel(stack, "Channel", new ChannelProps {
Inputs = new [] { new InputAttachment {
Input = input,
AudioSelectors = new [] { AudioSelector.ByLanguage("eng", "eng", AudioLanguageSelectionPolicy.STRICT) },
CaptionSelectors = new [] { CaptionSelector.Embedded("embedded") },
VideoSelector = new VideoSelectorSettings {
ColorSpace = VideoColorSpace.HDR10,
ColorSpaceUsage = VideoColorSpaceUsage.FORCE,
SelectBy = VideoSelection.ByProgramId(1)
}
} },
OutputGroups = new [] { OutputGroupConfiguration.Hls(new HlsOutputGroupProps {
Name = "hls",
Destinations = new [] { OutputDestination.ToBucket(bucket, "live/stream") },
Outputs = new [] { new HlsOutputDefinition { Encodes = new [] { video }, OutputName = "hls_out" } }
}) }
});
// Install: go get github.com/aws/aws-cdk-go/awsmedialivealpha/v2
var stack Stack
var input IInput
var bucket IBucket
var video EncodeConfiguration
medialive.NewChannel(stack, jsii.String("Channel"), &ChannelProps{
Inputs: []InputAttachment{
&InputAttachment{
Input: *Input,
AudioSelectors: []AudioSelector{
medialive.AudioSelector_ByLanguage(jsii.String("eng"), jsii.String("eng"), medialive.AudioLanguageSelectionPolicy_STRICT()),
},
CaptionSelectors: []CaptionSelector{
medialive.CaptionSelector_Embedded(jsii.String("embedded")),
},
VideoSelector: &VideoSelectorSettings{
ColorSpace: medialive.VideoColorSpace_HDR10(),
ColorSpaceUsage: medialive.VideoColorSpaceUsage_FORCE(),
SelectBy: medialive.VideoSelection_ByProgramId(jsii.Number(1)),
},
},
},
OutputGroups: []OutputGroupConfiguration{
medialive.OutputGroupConfiguration_Hls(&HlsOutputGroupProps{
Name: jsii.String("hls"),
Destinations: []OutputDestination{
medialive.OutputDestination_ToBucket(bucket, jsii.String("live/stream")),
},
Outputs: []HlsOutputDefinition{
&HlsOutputDefinition{
Encodes: []EncodeConfiguration{
video,
},
OutputName: jsii.String("hls_out"),
},
},
}),
},
})
Initializer
new Channel(scope: Construct, id: string, props: ChannelProps)
Channel(scope: Construct, id: str, props: ChannelProps)
new Channel(Construct scope, String id, ChannelProps props)
new Channel(Construct scope, string id, ChannelProps props)
NewChannel(Scope Construct, Id *string, Props ChannelProps)
Construct Props
anywhereSettingsoptionalAnywhereSettingsanywhere_settingsoptionalAnywhereSettingsanywhereSettingsoptionalAnywhereSettingsAnywhereSettingsoptionalAnywhereSettingsAnywhereSettingsoptionalAnywhereSettings#Default: not an Anywhere channel
availBlankingoptionalAvailBlankingavail_blankingoptionalAvailBlankingavailBlankingoptionalAvailBlankingAvailBlankingoptionalAvailBlankingAvailBlankingoptionalAvailBlanking#Default: avail blanking disabled
availSettingsoptionalAvailSettingsavail_settingsoptionalAvailSettingsavailSettingsoptionalAvailSettingsAvailSettingsoptionalAvailSettingsAvailSettingsoptionalAvailSettings#Default: no avail configuration
Defines how SCTE-35 markers are processed.
blackoutSlateoptionalBlackoutSlateblackout_slateoptionalBlackoutSlateblackoutSlateoptionalBlackoutSlateBlackoutSlateoptionalBlackoutSlateBlackoutSlateoptionalBlackoutSlate#Default: blackout slate disabled
Controls what is displayed during blackout events.
channelClassoptionalChannelClasschannel_classoptionalChannelClasschannelClassoptionalChannelClassChannelClassoptionalChannelClassChannelClassoptionalChannelClass= ChannelClass.SINGLE_PIPELINE#channelEngineVersionoptionalstringchannel_engine_versionoptionalstrchannelEngineVersionoptionalStringChannelEngineVersionoptionalstringChannelEngineVersionoptional*string#Default: service default
channelNameoptionalstringchannel_nameoptionalstrchannelNameoptionalStringChannelNameoptionalstringChannelNameoptional*string= auto-generated#channelSecurityGroupsoptionalIInputSecurityGroupRef[]channel_security_groupsoptionaltyping.List[IInputSecurityGroupRef]channelSecurityGroupsoptionalList<IInputSecurityGroupRef>ChannelSecurityGroupsoptionalIInputSecurityGroupRef[]ChannelSecurityGroupsoptional*[]IInputSecurityGroupRef#Default: no channel security groups
Controls which IP addresses can connect to the channel's outputs (pull-style outputs where downstream systems initiate connections).
colorCorrectionsoptionalColorCorrection[]color_correctionsoptionaltyping.List[ColorCorrection]colorCorrectionsoptionalList<ColorCorrection>ColorCorrectionsoptionalColorCorrection[]ColorCorrectionsoptional*[]ColorCorrection#Default: no color corrections
featureActivationsoptionalFeatureActivationsfeature_activationsoptionalFeatureActivationsfeatureActivationsoptionalFeatureActivationsFeatureActivationsoptionalFeatureActivationsFeatureActivationsoptionalFeatureActivations#Default: all features disabled
globalConfigurationoptionalGlobalConfigurationglobal_configurationoptionalGlobalConfigurationglobalConfigurationoptionalGlobalConfigurationGlobalConfigurationoptionalGlobalConfigurationGlobalConfigurationoptionalGlobalConfiguration#Default: default global configuration
inferenceFeedArnoptionalstringinference_feed_arnoptionalstrinferenceFeedArnoptionalStringInferenceFeedArnoptionalstringInferenceFeedArnoptional*string#Default: the channel is not associated to an inference feed
Future breaking change: this will change when Elemental Inference is released as an L2 construct.
inputsInputAttachment[]inputstyping.List[InputAttachment]inputsList<InputAttachment>InputsInputAttachment[]Inputs*[]InputAttachmentrequired#At least one is required. Additional inputs can be added with addInput().
inputSpecificationoptionalInputSpecificationinput_specificationoptionalInputSpecificationinputSpecificationoptionalInputSpecificationInputSpecificationoptionalInputSpecificationInputSpecificationoptionalInputSpecification#Default: InputSpecification.standard() (AVC codec, 20 Mbps max, HD resolution)
Defines the expected codec, bitrate, and resolution of the inputs, and whether they are standard, CDI, or Elemental Link inputs.
linkedChannelSettingsoptionalLinkedChannelSettingslinked_channel_settingsoptionalLinkedChannelSettingslinkedChannelSettingsoptionalLinkedChannelSettingsLinkedChannelSettingsoptionalLinkedChannelSettingsLinkedChannelSettingsoptionalLinkedChannelSettings#Default: not a linked channel
logLeveloptionalLogLevellog_leveloptionalLogLevellogLeveloptionalLogLevelLogLeveloptionalLogLevelLogLeveloptionalLogLevel= LogLevel.DISABLED#maintenanceoptionalMaintenanceSettingsmaintenanceoptionalMaintenanceSettingsmaintenanceoptionalMaintenanceSettingsMaintenanceoptionalMaintenanceSettingsMaintenanceoptionalMaintenanceSettings#Default: default maintenance window
motionGraphicsConfigurationoptionalMotionGraphicsConfigurationmotion_graphics_configurationoptionalMotionGraphicsConfigurationmotionGraphicsConfigurationoptionalMotionGraphicsConfigurationMotionGraphicsConfigurationoptionalMotionGraphicsConfigurationMotionGraphicsConfigurationoptionalMotionGraphicsConfiguration#Default: motion graphics disabled
nielsenConfigurationoptionalNielsenConfigurationnielsen_configurationoptionalNielsenConfigurationnielsenConfigurationoptionalNielsenConfigurationNielsenConfigurationoptionalNielsenConfigurationNielsenConfigurationoptionalNielsenConfiguration#Default: no Nielsen configuration
outputGroupsOutputGroupConfiguration[]output_groupstyping.List[OutputGroupConfiguration]outputGroupsList<OutputGroupConfiguration>OutputGroupsOutputGroupConfiguration[]OutputGroups*[]OutputGroupConfigurationrequired#A single channel can contain multiple output groups with different codecs (e.g. H.264 and H.265 ladders) sharing the same input.
Default: a role is auto-created with confused-deputy prevention
[disable-awslint:prefer-ref-interface]
scte35SegmentationScopeoptionalScte35SegmentationScopescte35_segmentation_scopeoptionalScte35SegmentationScopescte35SegmentationScopeoptionalScte35SegmentationScopeScte35SegmentationScopeoptionalScte35SegmentationScopeScte35SegmentationScopeoptionalScte35SegmentationScope#Default: service default
tagsoptional{ [key: string]: string }tagsoptionaltyping.Mapping[str, str]tagsoptionalMap<String, String>TagsoptionalIDictionary<string, string>Tagsoptional*map[string]*string#Default: no tags
thumbnailConfigurationoptionalThumbnailConfigurationthumbnail_configurationoptionalThumbnailConfigurationthumbnailConfigurationoptionalThumbnailConfigurationThumbnailConfigurationoptionalThumbnailConfigurationThumbnailConfigurationoptionalThumbnailConfiguration#Default: thumbnails disabled
timecodeConfigoptionalTimecodeConfigtimecode_configoptionalTimecodeConfigtimecodeConfigoptionalTimecodeConfigTimecodeConfigoptionalTimecodeConfigTimecodeConfigoptionalTimecodeConfig#Default: EMBEDDED source, no sync threshold
vpcoptionalVpcOutputSettingsvpcoptionalVpcOutputSettingsvpcoptionalVpcOutputSettingsVpcoptionalVpcOutputSettingsVpcoptionalVpcOutputSettings#Default: no VPC (outputs use public endpoints)
When set, all output endpoints are created in the specified VPC.
Properties
channelInputsmay be undefinedstring[]channel_inputsmay be undefinedtyping.List[str]channelInputsmay be undefinedList<String>ChannelInputsmay be undefinedstring[]ChannelInputsmay be undefined*[]*string#channelRefChannelReferencechannel_refChannelReferencechannelRefChannelReferenceChannelRefChannelReferenceChannelRefChannelReferencerequired#envResourceEnvironmentenvResourceEnvironmentenvResourceEnvironmentEnvResourceEnvironmentEnvResourceEnvironmentrequired#notes
For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.
grantsChannelGrantsgrantsChannelGrantsgrantsChannelGrantsGrantsChannelGrantsGrantsChannelGrantsrequired#PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#Methods
addInput(attachment: InputAttachment): voiddef add_input(self, attachment: InputAttachment) -> Nonepublic void addInput(InputAttachment attachment)public void AddInput(InputAttachment attachment)func AddInput(Attachment InputAttachment)#addOutputGroup(config: OutputGroupConfiguration): voiddef add_output_group(self, config: OutputGroupConfiguration) -> Nonepublic void addOutputGroup(OutputGroupConfiguration config)public void AddOutputGroup(OutputGroupConfiguration config)func AddOutputGroup(Config OutputGroupConfiguration)#Outputs are declared up front via the outputs prop on the group configuration.
applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#notes · 1 parameter
When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.
Parameters
strengthstrengthstrengthstrengthStrength— - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#notes
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).
fromChannelArn(scope: Construct, id: string, channelArn: string): IChannel@staticmethod def from_channel_arn(scope: Construct, id: str, channel_arn: str) -> IChannelpublic static IChannel fromChannelArn(Construct scope, String id, String channelArn)public static IChannel FromChannelArn(Construct scope, string id, string channelArn)func FromChannelArn(Scope Construct, Id *string, ChannelArn *string) IChannelstatic#The id is parsed out of the ARN.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#notes · 1 parameter · returns
Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.
Parameters
xxxxX— Any object.
Returns: true if x is an object created from a class which extends Construct.
isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#metric(metricName: string, pipeline: Pipeline, props?: MetricOptions): Metricdef metric(self, metric_name: str, pipeline: Pipeline, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metric(String metricName, Pipeline pipeline, MetricOptions props)public Metric Metric(string metricName, Pipeline pipeline, MetricOptions? props = null)func Metric(MetricName *string, Pipeline Pipeline, Props MetricOptions) Metric#notes
Channel metrics are published per-pipeline. STANDARD channels run two redundant pipelines (PIPELINE_0 and PIPELINE_1); to cover both, build a metric for each. SINGLE_PIPELINE channels only publish on PIPELINE_0. See the MediaLive metrics docs for the full set of metric names and recommended statistics.
metricActiveAlerts(pipeline: Pipeline, props?: MetricOptions): Metricdef metric_active_alerts(self, pipeline: Pipeline, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricActiveAlerts(Pipeline pipeline, MetricOptions props)public Metric MetricActiveAlerts(Pipeline pipeline, MetricOptions? props = null)func MetricActiveAlerts(Pipeline Pipeline, Props MetricOptions) Metric#metricDroppedFrames(pipeline: Pipeline, props?: MetricOptions): Metricdef metric_dropped_frames(self, pipeline: Pipeline, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricDroppedFrames(Pipeline pipeline, MetricOptions props)public Metric MetricDroppedFrames(Pipeline pipeline, MetricOptions? props = null)func MetricDroppedFrames(Pipeline Pipeline, Props MetricOptions) Metric#A non-zero value indicates the encoder cannot keep up with the incoming video in real time.
metricFillMsec(pipeline: Pipeline, props?: MetricOptions): Metricdef metric_fill_msec(self, pipeline: Pipeline, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricFillMsec(Pipeline pipeline, MetricOptions props)public Metric MetricFillMsec(Pipeline pipeline, MetricOptions? props = null)func MetricFillMsec(Pipeline Pipeline, Props MetricOptions) Metric#A non-zero value indicates an unhealthy input.
metricInputLossSeconds(pipeline: Pipeline, props?: MetricOptions): Metricdef metric_input_loss_seconds(self, pipeline: Pipeline, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricInputLossSeconds(Pipeline pipeline, MetricOptions props)public Metric MetricInputLossSeconds(Pipeline pipeline, MetricOptions? props = null)func MetricInputLossSeconds(Pipeline Pipeline, Props MetricOptions) Metric#metricInputVideoFrameRate(pipeline: Pipeline, props?: MetricOptions): Metricdef metric_input_video_frame_rate(self, pipeline: Pipeline, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricInputVideoFrameRate(Pipeline pipeline, MetricOptions props)public Metric MetricInputVideoFrameRate(Pipeline pipeline, MetricOptions? props = null)func MetricInputVideoFrameRate(Pipeline Pipeline, Props MetricOptions) Metric#metricNetworkIn(pipeline: Pipeline, props?: MetricOptions): Metricdef metric_network_in(self, pipeline: Pipeline, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricNetworkIn(Pipeline pipeline, MetricOptions props)public Metric MetricNetworkIn(Pipeline pipeline, MetricOptions? props = null)func MetricNetworkIn(Pipeline Pipeline, Props MetricOptions) Metric#metricNetworkOut(pipeline: Pipeline, props?: MetricOptions): Metricdef metric_network_out(self, pipeline: Pipeline, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricNetworkOut(Pipeline pipeline, MetricOptions props)public Metric MetricNetworkOut(Pipeline pipeline, MetricOptions? props = null)func MetricNetworkOut(Pipeline Pipeline, Props MetricOptions) Metric#metricSvqTime(pipeline: Pipeline, props?: MetricOptions): Metricdef metric_svq_time(self, pipeline: Pipeline, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSvqTime(Pipeline pipeline, MetricOptions props)public Metric MetricSvqTime(Pipeline pipeline, MetricOptions? props = null)func MetricSvqTime(Pipeline Pipeline, Props MetricOptions) Metric#Indicates the share of time MediaLive reduced quality optimisations to keep up with real-time output.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.