Open Source Newsletter #003

HLS Pull / Push Library

Container to push an RTSP stream as HLS to AWS MediaPackage

docker run --rm -e RTSP=rtsp://<username>:<password>@10.0.0.10/stream1 \ 
-e MEDIAPACKAGE_URL=<ingesturl> \
-e MEDIAPACKAGE_USERNAME=<username> \
-e MEDIAPACKAGE_PASSWORD=<password> \
-p 8000:8000 eyevinntechnology/rtsphls

Tiny MSE video and audio DRM detection library

import { isFairplaySupported } from "@eyevinn/is-drm-supported";

const isSupported = await isFairplaySupported();

Library to concatenate a list of VODs

import { HLSVod, IPlaylistEntry } from "@eyevinn/hls-vodtovod";const bw = event.queryStringParameters.bw;
const encodedMrssUri = event.queryStringParameters.mrss;
const playlist: IPlaylistEntry[] = await createPlaylistFromMRSS(new URL(decodeURIComponent(encodedMrssUri)));
const hlsVod = new HLSVod(playlist);
await hlsVod.load();
return generateManifestResponse(hlsVod.getVariant(bw).toString());

Library to append query params on segment URLs

const { HLSMultiVariant, HLSMediaPlaylist } = require("@eyevinn/hls-query");
const params = new URLSearchParams({ token: "TOKEN" });
const multiVariant = new HLSMultiVariant({
url: new URL("https://lab.cdn.eyevinn.technology/sto-slate.mp4/manifest.m3u8")
}, params);
await multiVariant.fetch();

const mediaPlaylist = new HLSMediaPlaylist({ url: multiVariant.streamURLs[0] }, params);
// multiVariant.streamURLs[0].href === "https://lab.cdn.eyevinn.technology/sto-slate.mp4/manifest_1.m3u8?token=TOKEN"
await mediaPlaylist.fetch();

console.log(mediaPlaylist.toString());
// #EXTM3U
// #EXT-X-VERSION:3
// #EXT-X-TARGETDURATION:10
// #EXT-X-MEDIA-SEQUENCE:1
// #EXT-X-PLAYLIST-TYPE:VOD
// #EXTINF:10.0000,
// manifest_1_00001.ts?token=TOKEN
// #EXT-X-ENDLIST

Lambda helper classes

const { LambdaELB } = require("@eyevinn/dev-lambda");

const handler = async (event) => {
console.log(event);
return { statusCode: 204 };
}

(new LambdaELB({ handler })).run();

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store