Experimental
@aws-cdk/aws-mediapackagev2-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
TsSegmentProps Struct
Properties for TS (Transport Stream) segment configuration.
| Stability | Experimental |
|---|---|
| Source | lib/endpoint.ts |
Example
ts
declare const channel: Channel;
new OriginEndpoint(this, 'TsEndpoint', {
channel,
segment: Segment.ts({
duration: Duration.seconds(6),
name: 'segment',
includeDvbSubtitles: true,
useAudioRenditionGroup: true,
includeIframeOnlyStreams: false,
scteFilter: [
ScteMessageType.BREAK,
ScteMessageType.DISTRIBUTOR_ADVERTISEMENT,
],
}),
manifests: [Manifest.hls({ manifestName: 'index' })],
});
new OriginEndpoint(this, 'CmafEndpoint', {
channel,
segment: Segment.cmaf({
duration: Duration.seconds(6),
name: 'segment',
includeIframeOnlyStreams: true,
scteFilter: [ScteMessageType.DISTRIBUTOR_ADVERTISEMENT],
}),
manifests: [Manifest.hls({ manifestName: 'index' })],
});
new OriginEndpoint(this, 'Endpoint', {
channel,
segment: Segment.cmaf(),
manifests: [Manifest.hls({ manifestName: 'index' })],
});
python
# channel: Channel
OriginEndpoint(self, "TsEndpoint",
channel=channel,
segment=Segment.ts(
duration=Duration.seconds(6),
name="segment",
include_dvb_subtitles=True,
use_audio_rendition_group=True,
include_iframe_only_streams=False,
scte_filter=[ScteMessageType.BREAK, ScteMessageType.DISTRIBUTOR_ADVERTISEMENT
]
),
manifests=[Manifest.hls(manifest_name="index")]
)
OriginEndpoint(self, "CmafEndpoint",
channel=channel,
segment=Segment.cmaf(
duration=Duration.seconds(6),
name="segment",
include_iframe_only_streams=True,
scte_filter=[ScteMessageType.DISTRIBUTOR_ADVERTISEMENT]
),
manifests=[Manifest.hls(manifest_name="index")]
)
OriginEndpoint(self, "Endpoint",
channel=channel,
segment=Segment.cmaf(),
manifests=[Manifest.hls(manifest_name="index")]
)
java
Channel channel;
OriginEndpoint.Builder.create(this, "TsEndpoint")
.channel(channel)
.segment(Segment.ts(TsSegmentProps.builder()
.duration(Duration.seconds(6))
.name("segment")
.includeDvbSubtitles(true)
.useAudioRenditionGroup(true)
.includeIframeOnlyStreams(false)
.scteFilter(List.of(ScteMessageType.BREAK, ScteMessageType.DISTRIBUTOR_ADVERTISEMENT))
.build()))
.manifests(List.of(Manifest.hls(HlsManifestConfiguration.builder().manifestName("index").build())))
.build();
OriginEndpoint.Builder.create(this, "CmafEndpoint")
.channel(channel)
.segment(Segment.cmaf(CmafSegmentProps.builder()
.duration(Duration.seconds(6))
.name("segment")
.includeIframeOnlyStreams(true)
.scteFilter(List.of(ScteMessageType.DISTRIBUTOR_ADVERTISEMENT))
.build()))
.manifests(List.of(Manifest.hls(HlsManifestConfiguration.builder().manifestName("index").build())))
.build();
OriginEndpoint.Builder.create(this, "Endpoint")
.channel(channel)
.segment(Segment.cmaf())
.manifests(List.of(Manifest.hls(HlsManifestConfiguration.builder().manifestName("index").build())))
.build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.MediaPackageV2.Alpha
Channel channel;
new OriginEndpoint(this, "TsEndpoint", new OriginEndpointProps {
Channel = channel,
Segment = Segment.Ts(new TsSegmentProps {
Duration = Duration.Seconds(6),
Name = "segment",
IncludeDvbSubtitles = true,
UseAudioRenditionGroup = true,
IncludeIframeOnlyStreams = false,
ScteFilter = new [] { ScteMessageType.BREAK, ScteMessageType.DISTRIBUTOR_ADVERTISEMENT }
}),
Manifests = new [] { Manifest.Hls(new HlsManifestConfiguration { ManifestName = "index" }) }
});
new OriginEndpoint(this, "CmafEndpoint", new OriginEndpointProps {
Channel = channel,
Segment = Segment.Cmaf(new CmafSegmentProps {
Duration = Duration.Seconds(6),
Name = "segment",
IncludeIframeOnlyStreams = true,
ScteFilter = new [] { ScteMessageType.DISTRIBUTOR_ADVERTISEMENT }
}),
Manifests = new [] { Manifest.Hls(new HlsManifestConfiguration { ManifestName = "index" }) }
});
new OriginEndpoint(this, "Endpoint", new OriginEndpointProps {
Channel = channel,
Segment = Segment.Cmaf(),
Manifests = new [] { Manifest.Hls(new HlsManifestConfiguration { ManifestName = "index" }) }
});
go
// Install: go get github.com/aws/aws-cdk-go/awsmediapackagev2alpha/v2
var channel Channel
awsmediapackagev2alpha.NewOriginEndpoint(this, jsii.String("TsEndpoint"), &OriginEndpointProps{
Channel: Channel,
Segment: awsmediapackagev2alpha.Segment_Ts(&TsSegmentProps{
Duration: awscdk.Duration_Seconds(jsii.Number(6)),
Name: jsii.String("segment"),
IncludeDvbSubtitles: jsii.Boolean(true),
UseAudioRenditionGroup: jsii.Boolean(true),
IncludeIframeOnlyStreams: jsii.Boolean(false),
ScteFilter: []ScteMessageType{
awsmediapackagev2alpha.ScteMessageType_BREAK,
awsmediapackagev2alpha.ScteMessageType_DISTRIBUTOR_ADVERTISEMENT,
},
}),
Manifests: []Manifest{
awsmediapackagev2alpha.Manifest_Hls(&HlsManifestConfiguration{
ManifestName: jsii.String("index"),
}),
},
})
awsmediapackagev2alpha.NewOriginEndpoint(this, jsii.String("CmafEndpoint"), &OriginEndpointProps{
Channel: Channel,
Segment: awsmediapackagev2alpha.Segment_Cmaf(&CmafSegmentProps{
Duration: awscdk.Duration_*Seconds(jsii.Number(6)),
Name: jsii.String("segment"),
IncludeIframeOnlyStreams: jsii.Boolean(true),
ScteFilter: []ScteMessageType{
awsmediapackagev2alpha.ScteMessageType_DISTRIBUTOR_ADVERTISEMENT,
},
}),
Manifests: []Manifest{
awsmediapackagev2alpha.Manifest_*Hls(&HlsManifestConfiguration{
ManifestName: jsii.String("index"),
}),
},
})
awsmediapackagev2alpha.NewOriginEndpoint(this, jsii.String("Endpoint"), &OriginEndpointProps{
Channel: Channel,
Segment: awsmediapackagev2alpha.Segment_*Cmaf(),
Manifests: []Manifest{
awsmediapackagev2alpha.Manifest_*Hls(&HlsManifestConfiguration{
ManifestName: jsii.String("index"),
}),
},
})
Properties
durationoptionalDurationdurationoptionalDurationdurationoptionalDurationDurationoptionalDurationDurationoptionalDuration = Duration.seconds(6) #Duration of each segment.
encryptionoptionalTsEncryptionencryptionoptionalTsEncryptionencryptionoptionalTsEncryptionEncryptionoptionalTsEncryptionEncryptionoptionalTsEncryption #Encryption configuration for the TS segment.
Default: No encryption
Use TsEncryption.speke() to create the configuration.
includeDvbSubtitlesoptionalbooleaninclude_dvb_subtitlesoptionalboolincludeDvbSubtitlesoptionalBooleanIncludeDvbSubtitlesoptionalboolIncludeDvbSubtitlesoptional*bool = false #Whether to include DVB subtitles.
includeIframeOnlyStreamsoptionalbooleaninclude_iframe_only_streamsoptionalboolincludeIframeOnlyStreamsoptionalBooleanIncludeIframeOnlyStreamsoptionalboolIncludeIframeOnlyStreamsoptional*bool = false #Whether to include I-frame-only streams.
nameoptionalstringnameoptionalstrnameoptionalStringNameoptionalstringNameoptional*string = 'segment' #Name of the segment.
scteFilteroptionalScteMessageType[]scte_filteroptionaltyping.List[ScteMessageType]scteFilteroptionalList<ScteMessageType>ScteFilteroptionalScteMessageType[]ScteFilteroptional*[]ScteMessageType #SCTE-35 message types to treat as ad markers.
Default: no filtering
scteInSegmentsoptionalScteInSegmentsscte_in_segmentsoptionalScteInSegmentsscteInSegmentsoptionalScteInSegmentsScteInSegmentsoptionalScteInSegmentsScteInSegmentsoptionalScteInSegments #Controls whether SCTE-35 messages are included in segment files.
Default: SCTE-35 messages are not included in segments
useAudioRenditionGroupoptionalbooleanuse_audio_rendition_groupoptionalbooluseAudioRenditionGroupoptionalBooleanUseAudioRenditionGroupoptionalboolUseAudioRenditionGroupoptional*bool = false #Whether to use audio rendition groups.