Skip to content
v2.278.0

Experimental

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

VideoColorSpaceUsage Class ​

Controls how the colorSpace value is used when it is not FOLLOW.

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' }],
    }),
  ],
});
python
# 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")]
        )
    ]
)
java
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();
csharp
// 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" } }
    }) }
});
go
// 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"),
				},
			},
		}),
	},
})

Properties ​

Use the input's color space data when present;

fall back to colorSpace only when the input has none.

Always use `colorSpace`, ignoring any color space data in the input.
valuestringvaluestrvalueStringValuestringValue*string #
The underlying string value passed to CloudFormation.

Methods ​

of(value: string): VideoColorSpaceUsage // chainable@staticmethod def of(value: str) -> VideoColorSpaceUsagepublic static VideoColorSpaceUsage of(String value)public static VideoColorSpaceUsage Of(string value)func Of(Value *string) VideoColorSpaceUsage static #
A value not yet modelled by AWS CDK.