Experimental
@aws-cdk/aws-medialive-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
Lut Class
The S3 location of a 3D LUT (look-up table) file used by a color-correction rule.
MediaLive reads the LUT from S3 at runtime, so the file must be in an S3 bucket — the URI must use the s3:// or s3ssl:// protocol. Unlike a FileLocation, a LUT has no credentials.
Use the static factory methods to create one from an S3 bucket (which uses the secure s3ssl:// form and auto-grants the channel role read access) or a raw S3 URL.
Example
ts
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' }],
}),
],
});
python
# stack: Stack
# bucket: s3.IBucket
# input: medialive.IInput
# video: medialive.EncodeConfiguration
# destination: medialive.OutputDestination
medialive.Channel(stack, "Channel",
inputs=[medialive.InputAttachment(input=input)],
color_corrections=[medialive.ColorCorrection(
input_color_space=medialive.ColorSpace.REC_601,
output_color_space=medialive.ColorSpace.REC_709,
lut=medialive.Lut.from_bucket(bucket, "luts/rec601-to-rec709.cube")
)],
output_groups=[
medialive.OutputGroupConfiguration.hls(
name="hls",
destinations=[destination],
outputs=[medialive.HlsOutputDefinition(encodes=[video], output_name="video")]
)
]
)
java
Stack stack;
IBucket bucket;
IInput input;
EncodeConfiguration video;
OutputDestination destination;
Channel.Builder.create(stack, "Channel")
.inputs(List.of(InputAttachment.builder().input(input).build()))
.colorCorrections(List.of(ColorCorrection.builder()
.inputColorSpace(ColorSpace.REC_601)
.outputColorSpace(ColorSpace.REC_709)
.lut(Lut.fromBucket(bucket, "luts/rec601-to-rec709.cube"))
.build()))
.outputGroups(List.of(OutputGroupConfiguration.hls(HlsOutputGroupProps.builder()
.name("hls")
.destinations(List.of(destination))
.outputs(List.of(HlsOutputDefinition.builder().encodes(List.of(video)).outputName("video").build()))
.build())))
.build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.MediaLive.Alpha
Stack stack;
IBucket bucket;
IInput input;
EncodeConfiguration video;
OutputDestination destination;
new Channel(stack, "Channel", new ChannelProps {
Inputs = new [] { new InputAttachment { Input = input } },
ColorCorrections = new [] { new ColorCorrection {
InputColorSpace = ColorSpace.REC_601,
OutputColorSpace = ColorSpace.REC_709,
Lut = Lut.FromBucket(bucket, "luts/rec601-to-rec709.cube")
} },
OutputGroups = new [] { OutputGroupConfiguration.Hls(new HlsOutputGroupProps {
Name = "hls",
Destinations = new [] { destination },
Outputs = new [] { new HlsOutputDefinition { Encodes = new [] { video }, OutputName = "video" } }
}) }
});
go
// Install: go get github.com/aws/aws-cdk-go/awsmedialivealpha/v2
var stack Stack
var bucket IBucket
var input IInput
var video EncodeConfiguration
var destination OutputDestination
medialive.NewChannel(stack, jsii.String("Channel"), &ChannelProps{
Inputs: []InputAttachment{
&InputAttachment{
Input: *Input,
},
},
ColorCorrections: []ColorCorrection{
&ColorCorrection{
InputColorSpace: medialive.ColorSpace_REC_601(),
OutputColorSpace: medialive.ColorSpace_REC_709(),
Lut: medialive.Lut_FromBucket(bucket, jsii.String("luts/rec601-to-rec709.cube")),
},
},
OutputGroups: []OutputGroupConfiguration{
medialive.OutputGroupConfiguration_Hls(&HlsOutputGroupProps{
Name: jsii.String("hls"),
Destinations: []OutputDestination{
destination,
},
Outputs: []HlsOutputDefinition{
&HlsOutputDefinition{
Encodes: []EncodeConfiguration{
video,
},
OutputName: jsii.String("video"),
},
},
}),
},
})
Initializer
ts
new Lut()
python
Lut()
java
new Lut()
csharp
new Lut()
go
NewLut()
Methods
fromBucket(bucket: IBucket, key: string): Lut // chainable@staticmethod def from_bucket(bucket: IBucket, key: str) -> Lutpublic static Lut fromBucket(IBucket bucket, String key)public static Lut FromBucket(IBucket bucket, string key)func FromBucket(Bucket IBucket, Key *string) Lutstatic#Reference a LUT file in an S3 bucket.
Uses the secure s3ssl:// form and automatically grants the channel role read access.
2 parameters
Parameters
bucketbucketbucketbucketBucket— The S3 bucket containing the LUT file.keykeykeykeyKey— The object key within the bucket (e.g. 'luts/rec709.cube').
url(url: string): Lut // chainable@staticmethod def url(url: str) -> Lutpublic static Lut url(String url)public static Lut Url(string url)func Url(Url *string) Lutstatic#Reference a LUT file by S3 URL.
The URL must use the s3:// or s3ssl:// protocol.
1 parameter
Parameters
urlurlurlurlUrl— Thes3://ors3ssl://URL of the LUT file.