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

The segment configuration, including the segment name, duration, and other configuration values.

Obtainable from: [Segment.cmaf](/cdk/api/v2/docs/@aws-cdk_aws-mediapackagev2-alpha.Segment.html#cmaf), [Segment.ism](/cdk/api/v2/docs/@aws-cdk_aws-mediapackagev2-alpha.Segment.html#ism), [Segment.ts](/cdk/api/v2/docs/@aws-cdk_aws-mediapackagev2-alpha.Segment.html#ts)

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/endpoint.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/@aws-cdk/aws-mediapackagev2-alpha/lib/endpoint.ts#L2354)

## Example

TypeScript:

```ts
declare const channel: Channel;
declare const spekeRole: iam.IRole;

new OriginEndpoint(this, 'TsEndpoint', {
  channel,
  segment: Segment.ts({
    encryption: TsEncryption.speke({
      method: TsEncryptionMethod.SAMPLE_AES,
      resourceId: 'my-content-id',
      url: 'https://example.com/speke',
      role: spekeRole,
    }),
  }),
  manifests: [Manifest.hls({ manifestName: 'index' })],
});
```

Python:

```python
# channel: Channel
# speke_role: iam.IRole

OriginEndpoint(self, "TsEndpoint",
    channel=channel,
    segment=Segment.ts(
        encryption=TsEncryption.speke(
            method=TsEncryptionMethod.SAMPLE_AES,
            resource_id="my-content-id",
            url="https://example.com/speke",
            role=speke_role
        )
    ),
    manifests=[Manifest.hls(manifest_name="index")]
)
```

Java:

```java
Channel channel;
IRole spekeRole;

OriginEndpoint.Builder.create(this, "TsEndpoint")
        .channel(channel)
        .segment(Segment.ts(TsSegmentProps.builder()
                .encryption(TsEncryption.speke(TsSpekeEncryptionProps.builder()
                        .method(TsEncryptionMethod.SAMPLE_AES)
                        .resourceId("my-content-id")
                        .url("https://example.com/speke")
                        .role(spekeRole)
                        .build()))
                .build()))
        .manifests(List.of(Manifest.hls(HlsManifestConfiguration.builder().manifestName("index").build())))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.MediaPackageV2.Alpha
Channel channel;
IRole spekeRole;

new OriginEndpoint(this, "TsEndpoint", new OriginEndpointProps {
    Channel = channel,
    Segment = Segment.Ts(new TsSegmentProps {
        Encryption = TsEncryption.Speke(new TsSpekeEncryptionProps {
            Method = TsEncryptionMethod.SAMPLE_AES,
            ResourceId = "my-content-id",
            Url = "https://example.com/speke",
            Role = spekeRole
        })
    }),
    Manifests = new [] { Manifest.Hls(new HlsManifestConfiguration { ManifestName = "index" }) }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awsmediapackagev2alpha/v2
var channel Channel
var spekeRole IRole

awsmediapackagev2alpha.NewOriginEndpoint(this, jsii.String("TsEndpoint"), &OriginEndpointProps{
	Channel: Channel,
	Segment: awsmediapackagev2alpha.Segment_Ts(&TsSegmentProps{
		Encryption: awsmediapackagev2alpha.TsEncryption_Speke(&TsSpekeEncryptionProps{
			Method: awsmediapackagev2alpha.TsEncryptionMethod_SAMPLE_AES,
			ResourceId: jsii.String("my-content-id"),
			Url: jsii.String("https://example.com/speke"),
			Role: spekeRole,
		}),
	}),
	Manifests: []Manifest{
		awsmediapackagev2alpha.Manifest_Hls(&HlsManifestConfiguration{
			ManifestName: jsii.String("index"),
		}),
	},
})
```

## Properties

- `containerType`: [ContainerType](/cdk/api/v2/docs/@aws-cdk_aws-mediapackagev2-alpha.ContainerType.html) (required) — The container type for this segment (TS or CMAF).

- `encryption`: [EncryptionConfiguration](/cdk/api/v2/docs/@aws-cdk_aws-mediapackagev2-alpha.EncryptionConfiguration.html) — Encryption configuration for the segment.

  **Default:** No encryption

- `includeIframeOnlyStreams`: boolean — Whether the segment includes I-frame-only streams.

  **Default:** undefined - Not specified.

- `scteFilter`: [ScteMessageType](/cdk/api/v2/docs/@aws-cdk_aws-mediapackagev2-alpha.ScteMessageType.html)[] — The SCTE-35 configuration associated with the segment.

  **Default:** No SCTE filtering

  The SCTE-35 message types that you want to be treated as ad markers in the output.

- `scteInSegments`: [ScteInSegments](/cdk/api/v2/docs/@aws-cdk_aws-mediapackagev2-alpha.ScteInSegments.html) — Controls whether SCTE-35 messages are included in segment files.

  **Default:** SCTE-35 messages are not included in segments

- `segmentDuration`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = 6 — The duration of the segments.

- `segmentName`: string = segment — The name of the segment associated with the origin endpoint.

- `tsIncludeDvbSubtitles`: boolean = false — Whether the segment includes DVB subtitles.

- `tsUseAudioRenditionGroup`: boolean = false — Whether the segment is an audio rendition group.
