awscdk-construct-scte-scheduler
AWS CDK Construct for scheduling SCTE-35 events using the MediaLive schedule API
- Input:
- MediaLive channel id
- SCTE event duration (seconds)
- Repeat interval (minutes)
- Output:
- Lambda function for calling MediaLive schedule API
- EventBridge rule for periodically invoking the function
Install
Usage
import { Stack, StackProps, CfnOutput } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import { LiveChannelFromMp4 } from 'awscdk-construct-live-channel-from-mp4-file';
import { ScteScheduler } from 'awscdk-construct-scte-scheduler';
export class ExampleStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
const {eml, emp} = new LiveChannelFromMp4(this, 'LiveChannelFromMp4', {
sourceUrl: 's3ssl://example_bucket/test.mp4',
timecodeBurninPrefix: 'Ch1',
autoStart: true,
});
new ScteScheduler(this, 'ScteScheduler', {
channelId: eml.channel.ref,
scteDurationInSeconds: 30,
intervalInMinutes: 1,
});
new CfnOutput(this, "MediaPackageEndpointURL", {
value: emp.endpoints.hls.attrUrl,
exportName: "MediaPackageEndpointURL",
description: "MediaPackage endpoint URL",
});
}
}