Service: Channel Engine Bridge - EyevinnOSC/community GitHub Wiki
Channel Engine Bridge (serviceId eyevinn-channel-engine-bridge) pulls an HLS channel from a FAST Channel Engine and pushes it to another live origin. It is a long-running service instance. License: MIT.
- Push a FAST Channel Engine channel to an AWS Elemental MediaPackage ingest endpoint.
- Push a channel to an AWS MediaStore container or an AWS S3 bucket that acts as origin.
- Useful when a CDN cannot simply pull from the FAST Channel Engine and the channel must be pushed to a separate live origin.
Create the instance with create-service-instance using serviceId: "eyevinn-channel-engine-bridge". The instance name must be alphanumeric and at most 20 characters. The bridge has no dependencies on other OSC services, but you need a source HLS stream (for example a channel from a FAST Channel Engine instance) and an AWS destination.
Store AWS credentials as service secrets first with create-service-secret (serviceId: "eyevinn-channel-engine-bridge"), and reference them as {{secrets.NAME}}.
Bridge to an S3 bucket:
{
"name": "guide",
"Source": "https://demo.ce.prod.osaas.io/channels/website/master.m3u8",
"DestType": "s3",
"DestUrl": "s3://<your-output-bucket>/hls/index.m3u8",
"AwsAccessKeyId": "{{secrets.awsaccesskeyid}}",
"AwsSecretAccessKey": "{{secrets.awssecretaccesskey}}",
"AwsRegion": "<region-where-your-bucket-is-placed>"
}Bridge to an AWS Media Package ingest endpoint (the whole ingest URL including credentials is stored in one secret):
{
"name": "guide",
"Source": "https://demo.ce.prod.osaas.io/channels/website/master.m3u8",
"DestType": "mediapackage",
"DestUrl": "{{secrets.mediapackageingest}}"
}Check that it runs with get-instance-status or wait-for-service-ready, and look at get-logs-for-instance if it does not push.
The same instances can be created with the OSC CLI:
osc create eyevinn-channel-engine-bridge guide \
-o Source=https://demo.ce.prod.osaas.io/channels/website/master.m3u8 \
-o DestType=s3 \
-o DestUrl=s3://<your-output-bucket>/hls/index.m3u8 \
-o AwsAccessKeyId="{{secrets.awsaccesskeyid}}" \
-o AwsSecretAccessKey="{{secrets.awssecretaccesskey}}" \
-o AwsRegion=eu-north-1| Option | Required | Type | Meaning |
|---|---|---|---|
| name | Yes | string | Name of the instance. Alphanumeric, at most 20 characters. |
| Source | Yes | string | URL of the source HLS stream (master playlist) to bridge, for example https://demo.ce.prod.osaas.io/channels/website/master.m3u8. |
| DestType | Yes | enum: mediapackage, mediastore, s3
|
Type of destination to push to. |
| DestUrl | Yes | string | Destination URL. For s3 use s3://<bucket>/<path>/index.m3u8. For mediapackage use the HLS ingest endpoint URL with credentials in the format https://<username>:<password>@<host>/in/v2/<id>/<id>/channel; store the whole value in a secret. For mediastore use the MediaStore data endpoint URL. |
| AwsAccessKeyId | No | string, sensitive | AWS access key id used when pushing to an S3 bucket. Store it as a secret and pass {{secrets.NAME}}. |
| AwsSecretAccessKey | No | string, sensitive | AWS secret access key used when pushing to an S3 bucket. Store it as a secret and pass {{secrets.NAME}}. |
| AwsRegion | No | string | AWS region where the destination bucket is placed, for example eu-north-1. |
A {{secrets.NAME}} reference must be the whole field value. Changing a secret later does not restart a running instance.
- Create a Media Package channel in the AWS console and note the URL, username and password of one of the HLS ingest endpoints.
- Create a secret
mediapackageingestwith the valuehttps://<username>:<password>@<URL>, where<URL>has the formatxxxxx.mediapackage.xxxxxx.amazonaws.com/in/v2/<id>/<id>/channel. - Create the bridge with
DestTypemediapackageandDestUrl{{secrets.mediapackageingest}}. - In the AWS console, create an origin endpoint for the Media Package channel, for example of type Apple HLS, and use its playback URL in an HLS player. An additional endpoint can be created for MPEG-DASH.
The HLS output is available at the URL your CDN (for example a CloudFront distribution) serves for the bucket, such as https://<your-cloudfront-distribution-for-the-bucket>/hls/index.m3u8, and can be played in any HLS capable video player.