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

A caption selector that identifies which captions to extract from the input.

Create with
the static factory methods — one per caption source format.

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

## Example

```ts
// Define a caption selector on the input attachment (see Input Attachment Settings below)
const captionSelector = medialive.CaptionSelector.embedded('captions');

// WebVTT captions — packaged alongside the video encode in the same output
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,
  }),
});
```

## Properties

- `name`: string — 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` (static) — Select ancillary captions.

- `arib(name: string): CaptionSelector // chainable` (static) — Select ARIB captions.

- `byLanguage(name: string, languageCode: string): CaptionSelector // chainable` (static) — Select captions by language code (no specific source format).

- `dvbSub(name: string, options?: DvbSubCaptionSourceOptions): CaptionSelector // chainable` (static) — Select DVB-Sub (image-based) captions.

- `embedded(name: string, options?: EmbeddedCaptionSourceOptions): CaptionSelector // chainable` (static) — Select embedded (CEA-608/708) captions.

- `scte20(name: string, options?: Scte20CaptionSourceOptions): CaptionSelector // chainable` (static) — Select SCTE-20 captions.

- `scte27(name: string, options?: Scte27CaptionSourceOptions): CaptionSelector // chainable` (static) — Select SCTE-27 (image-based) captions.

- `smartSubtitle(name: string, options?: SmartSubtitleSourceOptions): CaptionSelector // chainable` (static) — Select smart subtitles generated by Elemental Inference.

- `teletext(name: string, options?: TeletextCaptionSourceOptions): CaptionSelector // chainable` (static) — Select Teletext captions.
