> **Experimental**
>
> `@aws-cdk/aws-medialive-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# Channel

Defines an AWS Elemental MediaLive Channel.

Extends: Construct › Resource › Channel
Implements: IChannel, IResource, IEnvironmentAware, IChannelRef, IConstruct, IDependable

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/channel.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-medialive-alpha/lib/channel.ts#L997)

## Example

```ts
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' }],
    }),
  ],
});
```

## Initializer

```ts
new Channel(scope: Construct, id: string, props: ChannelProps)
```

## Construct Props

- `anywhereSettings`: [AnywhereSettings](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.AnywhereSettings.html) — Anywhere settings for running the channel on AWS Elemental Anywhere.

  **Default:** not an Anywhere channel

- `availBlanking`: [AvailBlanking](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.AvailBlanking.html) — Settings for blanking video, audio, and captions during ad avails.

  **Default:** avail blanking disabled

- `availSettings`: [AvailSettings](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.AvailSettings.html) — Ad avail handling configuration.

  **Default:** no avail configuration

  Defines how SCTE-35 markers are processed.

- `blackoutSlate`: [BlackoutSlate](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.BlackoutSlate.html) — Blackout slate configuration.

  **Default:** blackout slate disabled

  Controls what is displayed during blackout events.

- `channelClass`: [ChannelClass](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.ChannelClass.html) = ChannelClass.SINGLE_PIPELINE — The class of the channel (STANDARD for redundancy, SINGLE_PIPELINE for cost savings).

- `channelEngineVersion`: string — The engine version for the channel.

  **Default:** service default

- `channelName`: string = auto-generated — The name of the channel.

- `channelSecurityGroups`: [IInputSecurityGroupRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_medialive.IInputSecurityGroupRef.html)[] — Input security groups to associate with the channel.

  **Default:** no channel security groups

  Controls which IP addresses can connect
  to the channel's outputs (pull-style outputs where downstream systems initiate connections).

- `colorCorrections`: [ColorCorrection](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.ColorCorrection.html)[] — Global color correction rules applied to all outputs.

  **Default:** no color corrections

- `featureActivations`: [FeatureActivations](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.FeatureActivations.html) — Feature activations for the channel (e.g. Input Prepare schedule actions).

  **Default:** all features disabled

- `globalConfiguration`: [GlobalConfiguration](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.GlobalConfiguration.html) — Global configuration settings for the channel.

  **Default:** default global configuration

- `inferenceFeedArn`: string — An AWS Elemental Inference feed to send this channel's media to for inference processing.

  **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.

- `inputs`: [InputAttachment](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.InputAttachment.html)[] (required) — The input attachments for this channel.

  At least one is required.
  Additional inputs can be added with `addInput()`.

- `inputSpecification`: [InputSpecification](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.InputSpecification.html) — The input specification for this channel.

  **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.

- `linkedChannelSettings`: [LinkedChannelSettings](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.LinkedChannelSettings.html) — Linked channel settings for primary/follower channel configurations.

  **Default:** not a linked channel

- `logLevel`: [LogLevel](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.LogLevel.html) = LogLevel.DISABLED — The log level for the channel.

- `maintenance`: [MaintenanceSettings](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.MaintenanceSettings.html) — Maintenance window configuration for the channel.

  **Default:** default maintenance window

- `motionGraphicsConfiguration`: [MotionGraphicsConfiguration](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.MotionGraphicsConfiguration.html) — Motion graphics overlay configuration.

  **Default:** motion graphics disabled

- `nielsenConfiguration`: [NielsenConfiguration](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.NielsenConfiguration.html) — Nielsen watermark configuration.

  **Default:** no Nielsen configuration

- `outputGroups`: [OutputGroupConfiguration](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.OutputGroupConfiguration.html)[] (required) — The initial output groups for this channel. At least one is required. Additional output groups can be added with `addOutputGroup()`.

  A single channel can contain multiple output groups with different codecs
  (e.g. H.264 and H.265 ladders) sharing the same input.

- `role`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The IAM role for MediaLive to assume when running this channel.

  **Default:** a role is auto-created with confused-deputy prevention

  [disable-awslint:prefer-ref-interface]

- `scte35SegmentationScope`: [Scte35SegmentationScope](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.Scte35SegmentationScope.html) — Which output groups receive SCTE-35 segmentation cues.

  **Default:** service default

- `tags`: { [key: string]: string } — Tags to add to the channel.

  **Default:** no tags

- `thumbnailConfiguration`: [ThumbnailConfiguration](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.ThumbnailConfiguration.html) — Thumbnail generation configuration.

  **Default:** thumbnails disabled

- `timecodeConfig`: [TimecodeConfig](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.TimecodeConfig.html) — Timecode configuration for the channel.

  **Default:** EMBEDDED source, no sync threshold

- `vpc`: [VpcOutputSettings](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.VpcOutputSettings.html) — VPC output settings.

  **Default:** no VPC (outputs use public endpoints)

  When set, all output endpoints are created in the specified VPC.

## Properties

- `channelArn`: string — The ARN of the channel.

- `channelId`: string — The ID of the channel.

- `channelInputs`: string[] — The IDs of the inputs attached to this channel.

- `channelRef`: [ChannelReference](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_medialive.ChannelReference.html) — A reference to this Channel resource.

- `env`: [ResourceEnvironment](/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html) — The environment this resource belongs to.

  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.

- `grants`: [ChannelGrants](/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.ChannelGrants.html) — Collection of grant methods for this channel — start, stop, and update its schedule.

- `node`: [Node](/cdk/api/v2/docs/constructs.Node.html) — The tree node.

- `PROPERTY_INJECTION_ID`: string (static) — Uniquely identifies this class.

- `role`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The IAM role used by this channel.

- `stack`: [Stack](/cdk/api/v2/docs/aws-cdk-lib.Stack.html) — The stack in which this resource is defined.

## Methods

- `addInput(attachment: InputAttachment): void` — Attach an input to this channel.

- `addOutputGroup(config: OutputGroupConfiguration): void` — Add an output group to this channel.

  Outputs are declared up front via the `outputs` prop on the group configuration.

- `applyCrossStackReferenceStrength(strength: ReferenceStrength): void` — Override the cross-stack reference strength for this resource.

  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**

  - `strength` — - The reference strength to use for this resource.

- `applyRemovalPolicy(policy: RemovalPolicy): void` — Apply the given removal policy to this resource.

  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` (static) — Import an existing channel by its ARN.

  The id is parsed out of the ARN.

- `isConstruct(x: any): boolean` (static) — Checks if `x` is a construct.

  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**

  - `x` — Any object.

  **Returns:** true if `x` is an object created from a class which extends `Construct`.

- `isOwnedResource(construct: IConstruct): boolean` (static) — Returns true if the construct was created by CDK, and false otherwise.

- `isResource(construct: IConstruct): boolean` (static) — Check whether the given construct is a Resource.

- `metric(metricName: string, pipeline: Pipeline, props?: MetricOptions): Metric` — Create a CloudWatch metric for this channel scoped to a specific pipeline.

  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](https://docs.aws.amazon.com/medialive/latest/ug/monitoring-eml-metrics.html)
  for the full set of metric names and recommended statistics.

- `metricActiveAlerts(pipeline: Pipeline, props?: MetricOptions): Metric` — Metric for the total number of active alerts on this channel.

- `metricDroppedFrames(pipeline: Pipeline, props?: MetricOptions): Metric` — Metric for dropped frames.

  A non-zero value indicates the encoder cannot
  keep up with the incoming video in real time.

- `metricFillMsec(pipeline: Pipeline, props?: MetricOptions): Metric` — Metric for fill milliseconds — the time MediaLive has filled the video output with fill frames because the input did not deliver content within the expected window.

  A non-zero value indicates an unhealthy input.

- `metricInputLossSeconds(pipeline: Pipeline, props?: MetricOptions): Metric` — Metric for input loss seconds (RTP and MediaConnect inputs only).

- `metricInputVideoFrameRate(pipeline: Pipeline, props?: MetricOptions): Metric` — Metric for the input video frame rate (frames per second).

- `metricNetworkIn(pipeline: Pipeline, props?: MetricOptions): Metric` — Metric for the rate of inbound network traffic to MediaLive in Mbps.

- `metricNetworkOut(pipeline: Pipeline, props?: MetricOptions): Metric` — Metric for the rate of outbound network traffic from MediaLive in Mbps.

- `metricSvqTime(pipeline: Pipeline, props?: MetricOptions): Metric` — Metric for SVQ time (speed-vs-quality), expressed as a percent.

  Indicates
  the share of time MediaLive reduced quality optimisations to keep up with
  real-time output.

- `toString(): string` — Returns a string representation of this construct.

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  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.
