awscdk-construct-scte-scheduler
TypeScript icon, indicating that this package has built-in type declarations

0.0.24 • Public • Published

awscdk-construct-scte-scheduler

View on Construct Hub

AWS CDK Construct for scheduling SCTE-35 events using the MediaLive schedule API

  • Input:
    • MediaLive channel id
    • SCTE event duration (seconds)
    • Repeat interval (minutes)
    • Repeat count (optional)
    • Lambda function to be called after the repeat (optional)
  • Output:
    • Lambda function for calling MediaLive schedule API
    • EventBridge rule or Stepfunctions state machine for periodically invoking the function

Install

NPM

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

    // Create a live channel (MediaLive + MediaPackage)
    const {eml, emp} = new LiveChannelFromMp4(this, 'LiveChannelFromMp4', {
      sourceUrl: 's3ssl://example_bucket/test.mp4',
      timecodeBurninPrefix: 'Ch1',
      autoStart: true,
    });

    // Schedule a 30-sec ad break every minute
    new ScteScheduler(this, 'ScteScheduler', {
      channelId: eml.channel.ref,
      scteDurationInSeconds: 30,
      intervalInMinutes: 1,
      repeqtCount: 5,
    });

    // Print MediaPackage endpoint URL (HLS)
    new CfnOutput(this, "MediaPackageEndpointURL", {
      value: emp.endpoints.hls.attrUrl,
      exportName: "MediaPackageEndpointURL",
      description: "MediaPackage endpoint URL",
    });
  }
}

Package Sidebar

Install

npm i awscdk-construct-scte-scheduler

Weekly Downloads

743

Version

0.0.24

License

MIT

Unpacked Size

7.78 MB

Total Files

3296

Last publish

Collaborators

  • kuu