Skip to content
v2.274.0

Experimental

@aws-cdk/aws-medialive-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

VideoSelection Class ​

Selects the specific video to extract from the input — by PID or by program.

Create with the static factory methods; exactly one selection applies, enforced by the type.

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 VideoSelection()
python
VideoSelection()
java
new VideoSelection()
csharp
new VideoSelection()
go
NewVideoSelection()

Methods ​

byPid(pid: number): VideoSelection // chainable@staticmethod def by_pid(pid: int | float) -> VideoSelectionpublic static VideoSelection byPid(Number pid)public static VideoSelection ByPid(double pid)func ByPid(Pid *float64) VideoSelectionstatic#
Extract the video with this PID.
byProgramId(programId: number): VideoSelection // chainable@staticmethod def by_program_id(program_id: int | float) -> VideoSelectionpublic static VideoSelection byProgramId(Number programId)public static VideoSelection ByProgramId(double programId)func ByProgramId(ProgramId *float64) VideoSelectionstatic#
Extract the video from this program within a multi-program transport stream.

If the program doesn't exist, MediaLive selects the first program in the stream.