Experimental
@aws-cdk/aws-medialive-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
CaptionSelector Class
A caption selector that identifies which captions to extract from the input.
Create with the static factory methods — one per caption source format.
Example
ts
// Define a caption selector on the input attachment (see Input Attachment Settings below)
const captionSelector = medialive.CaptionSelector.embedded('captions');
// WebVTT captions
const webvtt = medialive.EncodeConfiguration.caption({
name: 'eng_webvtt',
captionSelectorName: captionSelector.name,
languageCode: 'eng',
languageDescription: 'English',
destination: medialive.CaptionDestination.webvtt(),
});
// Burned-in captions — rendered into the video, styled via the burn-in options
const burnIn = medialive.EncodeConfiguration.caption({
name: 'eng_burnin',
captionSelectorName: captionSelector.name,
destination: medialive.CaptionDestination.burnIn({
alignment: medialive.CaptionAlignment.CENTERED,
fontColor: medialive.CaptionFontColor.WHITE,
outlineColor: medialive.CaptionOutlineColor.BLACK,
fontSize: medialive.CaptionFontSize.AUTO,
}),
});
python
# Define a caption selector on the input attachment (see Input Attachment Settings below)
caption_selector = medialive.CaptionSelector.embedded("captions")
# WebVTT captions
webvtt = medialive.EncodeConfiguration.caption(
name="eng_webvtt",
caption_selector_name=caption_selector.name,
language_code="eng",
language_description="English",
destination=medialive.CaptionDestination.webvtt()
)
# Burned-in captions — rendered into the video, styled via the burn-in options
burn_in = medialive.EncodeConfiguration.caption(
name="eng_burnin",
caption_selector_name=caption_selector.name,
destination=medialive.CaptionDestination.burn_in(
alignment=medialive.CaptionAlignment.CENTERED,
font_color=medialive.CaptionFontColor.WHITE,
outline_color=medialive.CaptionOutlineColor.BLACK,
font_size=medialive.CaptionFontSize.AUTO
)
)
java
// Define a caption selector on the input attachment (see Input Attachment Settings below)
CaptionSelector captionSelector = CaptionSelector.embedded("captions");
// WebVTT captions
EncodeConfiguration webvtt = EncodeConfiguration.caption(CaptionEncodeProps.builder()
.name("eng_webvtt")
.captionSelectorName(captionSelector.getName())
.languageCode("eng")
.languageDescription("English")
.destination(CaptionDestination.webvtt())
.build());
// Burned-in captions — rendered into the video, styled via the burn-in options
EncodeConfiguration burnIn = EncodeConfiguration.caption(CaptionEncodeProps.builder()
.name("eng_burnin")
.captionSelectorName(captionSelector.getName())
.destination(CaptionDestination.burnIn(BurnInDestinationProps.builder()
.alignment(CaptionAlignment.CENTERED)
.fontColor(CaptionFontColor.WHITE)
.outlineColor(CaptionOutlineColor.BLACK)
.fontSize(CaptionFontSize.AUTO)
.build()))
.build());
csharp
// Install: dotnet add package Amazon.CDK.AWS.MediaLive.Alpha
// Define a caption selector on the input attachment (see Input Attachment Settings below)
var captionSelector = CaptionSelector.Embedded("captions");
// WebVTT captions
var webvtt = EncodeConfiguration.Caption(new CaptionEncodeProps {
Name = "eng_webvtt",
CaptionSelectorName = captionSelector.Name,
LanguageCode = "eng",
LanguageDescription = "English",
Destination = CaptionDestination.Webvtt()
});
// Burned-in captions — rendered into the video, styled via the burn-in options
var burnIn = EncodeConfiguration.Caption(new CaptionEncodeProps {
Name = "eng_burnin",
CaptionSelectorName = captionSelector.Name,
Destination = CaptionDestination.BurnIn(new BurnInDestinationProps {
Alignment = CaptionAlignment.CENTERED,
FontColor = CaptionFontColor.WHITE,
OutlineColor = CaptionOutlineColor.BLACK,
FontSize = CaptionFontSize.AUTO
})
});
go
// Install: go get github.com/aws/aws-cdk-go/awsmedialivealpha/v2
// Define a caption selector on the input attachment (see Input Attachment Settings below)
captionSelector := medialive.CaptionSelector_Embedded(jsii.String("captions"))
// WebVTT captions
webvtt := medialive.EncodeConfiguration_Caption(&CaptionEncodeProps{
Name: jsii.String("eng_webvtt"),
CaptionSelectorName: captionSelector.Name,
LanguageCode: jsii.String("eng"),
LanguageDescription: jsii.String("English"),
Destination: medialive.CaptionDestination_Webvtt(),
})
// Burned-in captions — rendered into the video, styled via the burn-in options
burnIn := medialive.EncodeConfiguration_Caption(&CaptionEncodeProps{
Name: jsii.String("eng_burnin"),
CaptionSelectorName: captionSelector.*Name,
Destination: medialive.CaptionDestination_BurnIn(&BurnInDestinationProps{
Alignment: medialive.CaptionAlignment_CENTERED(),
FontColor: medialive.CaptionFontColor_WHITE(),
OutlineColor: medialive.CaptionOutlineColor_BLACK(),
FontSize: medialive.CaptionFontSize_AUTO(),
}),
})
Properties
The name of this caption selector, used to associate it with caption outputs.
Unique within a channel.
Methods
ancillary(name: string, options?: AncillaryCaptionSourceOptions): CaptionSelector // chainable@staticmethod def ancillary(name: str, options: typing.Optional[AncillaryCaptionSourceOptions] = None) -> CaptionSelectorpublic static CaptionSelector ancillary(String name, AncillaryCaptionSourceOptions options)public static CaptionSelector Ancillary(string name, AncillaryCaptionSourceOptions? options = null)func Ancillary(Name *string, Options AncillaryCaptionSourceOptions) CaptionSelectorstatic#Select ancillary captions.
arib(name: string): CaptionSelector // chainable@staticmethod def arib(name: str) -> CaptionSelectorpublic static CaptionSelector arib(String name)public static CaptionSelector Arib(string name)func Arib(Name *string) CaptionSelectorstatic#Select ARIB captions.
byLanguage(name: string, languageCode: string): CaptionSelector // chainable@staticmethod def by_language(name: str, language_code: str) -> CaptionSelectorpublic static CaptionSelector byLanguage(String name, String languageCode)public static CaptionSelector ByLanguage(string name, string languageCode)func ByLanguage(Name *string, LanguageCode *string) CaptionSelectorstatic#Select captions by language code (no specific source format).
dvbSub(name: string, options?: DvbSubCaptionSourceOptions): CaptionSelector // chainable@staticmethod def dvb_sub(name: str, options: typing.Optional[DvbSubCaptionSourceOptions] = None) -> CaptionSelectorpublic static CaptionSelector dvbSub(String name, DvbSubCaptionSourceOptions options)public static CaptionSelector DvbSub(string name, DvbSubCaptionSourceOptions? options = null)func DvbSub(Name *string, Options DvbSubCaptionSourceOptions) CaptionSelectorstatic#Select DVB-Sub (image-based) captions.
embedded(name: string, options?: EmbeddedCaptionSourceOptions): CaptionSelector // chainable@staticmethod def embedded(name: str, options: typing.Optional[EmbeddedCaptionSourceOptions] = None) -> CaptionSelectorpublic static CaptionSelector embedded(String name, EmbeddedCaptionSourceOptions options)public static CaptionSelector Embedded(string name, EmbeddedCaptionSourceOptions? options = null)func Embedded(Name *string, Options EmbeddedCaptionSourceOptions) CaptionSelectorstatic#Select embedded (CEA-608/708) captions.
scte20(name: string, options?: Scte20CaptionSourceOptions): CaptionSelector // chainable@staticmethod def scte20(name: str, options: typing.Optional[Scte20CaptionSourceOptions] = None) -> CaptionSelectorpublic static CaptionSelector scte20(String name, Scte20CaptionSourceOptions options)public static CaptionSelector Scte20(string name, Scte20CaptionSourceOptions? options = null)func Scte20(Name *string, Options Scte20CaptionSourceOptions) CaptionSelectorstatic#Select SCTE-20 captions.
scte27(name: string, options?: Scte27CaptionSourceOptions): CaptionSelector // chainable@staticmethod def scte27(name: str, options: typing.Optional[Scte27CaptionSourceOptions] = None) -> CaptionSelectorpublic static CaptionSelector scte27(String name, Scte27CaptionSourceOptions options)public static CaptionSelector Scte27(string name, Scte27CaptionSourceOptions? options = null)func Scte27(Name *string, Options Scte27CaptionSourceOptions) CaptionSelectorstatic#Select SCTE-27 (image-based) captions.
smartSubtitle(name: string, options?: SmartSubtitleSourceOptions): CaptionSelector // chainable@staticmethod def smart_subtitle(name: str, options: typing.Optional[SmartSubtitleSourceOptions] = None) -> CaptionSelectorpublic static CaptionSelector smartSubtitle(String name, SmartSubtitleSourceOptions options)public static CaptionSelector SmartSubtitle(string name, SmartSubtitleSourceOptions? options = null)func SmartSubtitle(Name *string, Options SmartSubtitleSourceOptions) CaptionSelectorstatic#Select smart subtitles generated by Elemental Inference.
teletext(name: string, options?: TeletextCaptionSourceOptions): CaptionSelector // chainable@staticmethod def teletext(name: str, options: typing.Optional[TeletextCaptionSourceOptions] = None) -> CaptionSelectorpublic static CaptionSelector teletext(String name, TeletextCaptionSourceOptions options)public static CaptionSelector Teletext(string name, TeletextCaptionSourceOptions? options = null)func Teletext(Name *string, Options TeletextCaptionSourceOptions) CaptionSelectorstatic#Select Teletext captions.