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

The output caption format for a caption encode.

Use the static factory methods to select one of
the supported destination types.

Obtainable from: CaptionDestination.arib, CaptionDestination.burnIn, CaptionDestination.dvbSub, CaptionDestination.ebuTtD, CaptionDestination.embedded, CaptionDestination.embeddedPlusScte20, CaptionDestination.rtmpCaptionInfo, CaptionDestination.scte20PlusEmbedded, CaptionDestination.smpteTt, CaptionDestination.teletext, CaptionDestination.ttml, CaptionDestination.webvtt

- Stability: [Experimental](https://docs.aws.amazon.com/cdk/api/stability.html)
- Source: [`lib/caption-settings.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/@aws-cdk/aws-medialive-alpha/lib/caption-settings.ts#L425)

## Example

TypeScript:

```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:

```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:

```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());
```

C# / .NET:

```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
    })
});
```

Golang:

```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(),
	}),
})
```

## Initializer

TypeScript:

```ts
new CaptionDestination()
```

Python:

```python
CaptionDestination()
```

Java:

```java
new CaptionDestination()
```

C# / .NET:

```csharp
new CaptionDestination()
```

Golang:

```go
NewCaptionDestination()
```

## Methods

- `arib(): CaptionDestination // chainable` (static) — ARIB captions.

- `burnIn(props?: BurnInDestinationProps): CaptionDestination // chainable` (static) — Burned-in captions rendered into the video.

- `dvbSub(props?: DvbSubDestinationProps): CaptionDestination // chainable` (static) — DVB-Sub bitmap captions.

- `ebuTtD(props?: EbuTtDDestinationProps): CaptionDestination // chainable` (static) — EBU-TT-D sidecar captions.

- `embedded(): CaptionDestination // chainable` (static) — Embedded (CEA-608/708) captions.

- `embeddedPlusScte20(): CaptionDestination // chainable` (static) — Embedded plus SCTE-20 captions.

- `rtmpCaptionInfo(): CaptionDestination // chainable` (static) — RTMP CaptionInfo captions.

- `scte20PlusEmbedded(): CaptionDestination // chainable` (static) — SCTE-20 plus embedded captions.

- `smpteTt(): CaptionDestination // chainable` (static) — SMPTE-TT sidecar captions.

- `teletext(): CaptionDestination // chainable` (static) — Teletext captions.

- `ttml(props?: TtmlDestinationProps): CaptionDestination // chainable` (static) — TTML sidecar captions.

- `webvtt(props?: WebvttDestinationProps): CaptionDestination // chainable` (static) — WebVTT sidecar captions.
