Service: FAST Channel Engine - EyevinnOSC/community GitHub Wiki

FAST Channel Engine

The FAST Channel Engine (serviceId channel-engine) generates linear streaming channels (FAST channels) from HLS VOD content. It uses VOD2Live and manifest manipulation on already transcoded files, so no live encoding or transcoding is needed and the quality of the VOD files is maintained. In Eyevinn Open Source Cloud (OSC) each channel is one service instance. License: Apache-2.0. Source: Eyevinn/docker-fast, built on the open source Eyevinn Channel Engine library.

What it can do

  • Create many FAST channels with a fraction of the energy of live-transcoded channels, because there is no redundant transcoding or packaging.
  • Pick content with plugins: Loop (loop one VOD), Playlist (loop a playlist of VODs), WebHook (an HTTP endpoint answers what to play next) and Barker.
  • Insert a preroll with every plugin, and pass through ad opportunity markers; works with Server-Side Ad Insertion providers (for example Yospace, AWS MediaTailor, Nowtilus).
  • Support demuxed audio, VTT subtitles, language lists and codec presets.

Creating an instance

Prerequisite: VOD files in HLS format, publicly reachable (see VOD Transcoding for how to create them with OSC services). For a WebHook channel, first create the service that serves the webhook (for example a Web Runner) and confirm it is running.

Call create-service-instance with serviceId: "channel-engine". name is the channel name, type selects the plugin and url is the VOD, playlist or webhook URL. Options with a dot in their name are nested objects (opts), not flat keys:

{
  "name": "guide",
  "type": "Loop",
  "url": "https://lab.cdn.eyevinn.technology/Channel-Engine-Promo-Mar-2023-PnA8E-jw5x.mp4/manifest.m3u8",
  "opts": { "useDemuxedAudio": false, "useVttSubtitles": false }
}

Verify with wait-for-service-ready or get-instance-status, then describe-service-instance for the HLS playback URL, which has the form https://<tenant>.ce.prod.osaas.io/channels/<name>/master.m3u8. Play it in any HLS-capable player. OSC CLI equivalent:

% osc create channel-engine guide \
  -o type=Loop \
  -o url=https://lab.cdn.eyevinn.technology/Channel-Engine-Promo-Mar-2023-PnA8E-jw5x.mp4/manifest.m3u8 \
  -o opts.useDemuxedAudio=false \
  -o opts.useVttSubtitles=false

Options

Option Required Type Meaning
name Yes string Channel name. Catalog default mychannel. Instance names are alphanumeric, at most 20 characters.
type Yes enum: Loop, Playlist, WebHook, Barker Plugin type that decides where content comes from. Catalog default Loop.
url Yes string, must start with http For Loop: URL of the VOD HLS manifest. For Playlist: URL of a publicly accessible text file with one VOD URL per line. For WebHook: URL of the endpoint that returns what to play next.
opts.useDemuxedAudio No boolean Set true if the VOD has demuxed audio (audio separated from video segments). Catalog default true.
opts.useVttSubtitles No boolean Set true if the VOD has VTT subtitles. Catalog default true.
opts.defaultSlateUri No string, must start with http URI to a default slate.
opts.langList No list Comma-separated list of audio languages.
opts.langListSubs No list Comma-separated list of subtitle languages.
opts.preset No enum: DD, HEVC, ATMOS Channel preset.
opts.preroll.url No string, must start with http URL to a preroll VOD played at the start.
opts.preroll.duration No string, digits only Duration of the preroll in milliseconds.
opts.webhook.apikey No string API key for the webhook (used with the WebHook type).

The catalog does not mark any option as sensitive.

Using the instance

Loop a playlist of VODs

Create a text file with one HLS VOD URL per line and make it publicly reachable (for example a raw public GitHub Gist). Then create the channel with type: "Playlist" and url set to the raw URL of that file:

{
  "name": "guide",
  "type": "Playlist",
  "url": "https://gist.githubusercontent.com/<user>/<id>/raw/<rev>/gistfile1.txt",
  "opts": { "useDemuxedAudio": false, "useVttSubtitles": false }
}

Decide what to play with a WebHook

With type: "WebHook" the engine calls your endpoint (with a channelId query parameter) to get the next VOD, so the decision is taken just in time. The endpoint returns JSON with id, title, hlsUrl and optionally prerollUrl and prerollDurationMs. A minimal Node.js (fastify) webhook that picks a random VOD and adds a preroll:

const fastify = require('fastify');
const { randomUUID } = require('node:crypto');

const app = fastify();
app.get('/nextVod', (request, reply) => {
  const channelId = request.query.channelId;
  const vods = [
    'https://lab.cdn.eyevinn.technology/stswetvplus-promo-2023-5GBm231Mkz.mov/manifest.m3u8',
    'https://lab.cdn.eyevinn.technology/Channel-Engine-Promo-Mar-2023-PnA8E-jw5x.mp4/manifest.m3u8',
    'https://lab.cdn.eyevinn.technology/eyevinn-reel-feb-2023-_2Y7i4eOAi.mp4/manifest.m3u8'
  ];
  reply.send({
    id: randomUUID(),
    title: 'Example',
    hlsUrl: vods[Math.floor(Math.random() * vods.length)],
    prerollUrl: 'https://maitv-vod.lab.eyevinn.technology/VINN.mp4/master.m3u8',
    prerollDurationMs: 105000
  });
});

app.listen({ port: 8080, host: '0.0.0.0' });

Host it by pushing the code to a Git repository and creating a Web Runner instance for it. Then create the channel with type: "WebHook" and url set to the Web Runner URL plus /nextVod.

Insert mid-roll ad opportunities

Insert a "house ad" into the source VOD. The server-side ad inserter downstream can then replace it with an ad chosen by the ad server. Use the HLS VOD Stitcher as a proxy between the source VOD and the engine. It takes a base64-encoded JSON payload in the payload query parameter, for example:

{
  "uri": "https://maitv-vod.lab.eyevinn.technology/UNHINGED_Trailer_2020.mp4/master.m3u8",
  "breaks": [
    { "pos": 20000, "duration": 15000, "url": "https://maitv-vod.lab.eyevinn.technology/VINN.mp4/master.m3u8" }
  ]
}

The stitched VOD is https://<stitcher-url>/stitch/master.m3u8?payload=<base64 JSON>. Use that URL as the VOD in a Loop channel, in a playlist, or as hlsUrl in a webhook response. About 20 seconds into the VOD the house ad plays. The open source Test Adserver can emulate an ad server for testing.

To push a channel to another live origin (for example AWS MediaPackage or an S3 bucket) use the Channel Engine Bridge.

Limitations

  • Only HLS VOD sources are supported. For both HLS and MPEG-DASH output, use a Channel Engine Bridge to a repackager origin.
  • The service does not currently integrate with the FAST Engine Scheduling service.

Resources

⚠️ **GitHub.com Fallback** ⚠️