Open Source Newsletter #004
In the Eyevinn Open Source Newsletter we present the latest updates and additions to our libraries, tools and components that we have made available as open source.
Open Source FAST Channel Engine based on VOD2Live technology
Eyevinn Channel Engine is a core component library for creating FAST channels based on VOD2Live technology and it is open source. Combine this VOD2live technology component with your business and scheduling logic to build your very own and unique FAST channel engine. To help you get started we have now made available a documentation site including the usage guide, tutorials and more. The documentation is available here: https://vod2live.docs.eyevinn.technology
Tools and Libraries for WebRTC based streaming
In our project to validate and prototyping WebRTC based distribution with standardized ingress (WHIP) and egress (proposed WHPP) protocol we have developed a couple of tools and libraries that we made available as open source.
WHIP mpegts
A command line tool based on gstreamer that can consume an MPEG-TS stream, re-transcode and push to a WHIP compatible WebRTC media server endpoint.
GitHub: https://github.com/Eyevinn/whip-mpegts
Binary installation using Homebrew:
brew tap eyevinn/tools
brew install whip-mpegtsListen on port 1234 and push to a WHIP endpoint. Replace GST_PLUGIN_PATH with the location of GST plugins on your computer.
export GST_PLUGIN_PATH=/opt/homebrew/lib/gstreamer-1.0
whip-mpegts -a 0.0.0.0 \
-p 1234 \
-u https://whip.dev.eyevinn.technology/api/v1/whip/broadcasterWHIP web client
To build a web-based application for ingestion using the WHIP protocol we have made an NPM package available under open source.
NPM: https://www.npmjs.com/package/@eyevinn/whip-web-client
npm install --save @eyevinn/whip-web-clientExample usage:
import { WHIPClient } from "@eyevinn/whip-web-client"
const client = new WHIPClient({
endpoint: "http://<host>/whip/broadcaster"
});
const videoIngest = document.querySelector<HTMLVideoElement>("video#ingest");
const mediaStream = await navigator.mediaDevices.getUserMedia({
video: true,
audio: true,
});
videoIngest.srcObject = mediaStream;
await client.ingest(mediaStream);WHPP play
A command line tool also based on gstreamer for playback of a WebRTC stream that is made available by a media server endpoint that is WHPP compatible.
GitHub: https://github.com/Eyevinn/whpp-play
Binary installation with Homebrew:
brew tap eyevinn/tools
brew install whpp-playTo playback a WHPP stream you run.
export GST_PLUGIN_PATH=/opt/homebrew/lib/gstreamer-1.0
whpp-play https://broadcaster.lab.sto.eyevinn.technology:8443/broadcaster/channel/sthlmWHPP Web Client
For playback in a web browser we have an NPM package that currently includes adapter for SDP handshaking based on the WHPP protocol but can be easily extended to support other HTTP based protocols such as WHEP.
NPM: https://www.npmjs.com/package/@eyevinn/webrtc-player
npm install @eyevinn/webrtc-playerExample code snippet:
import { WebRTCPlayer } from "@eyevinn/webrtc-player";
const video = document.querySelector("video");
const player = new WebRTCPlayer({ video: video, type: "se.eyevinn.whpp" });
await player.load(new URL(channelUrl));WHIP and WHPP distribution components
To build a WHIP server endpoint we have made available an NPM package that you can start from. Being plugin based you can extend it to support various “sinks” where one sink could be a WebRTC Selective Forwarding Unit (SFU). Included in the library is the integration with an open source WebRTC media server called Symphony Media Bridge.
NPM: https://www.npmjs.com/package/@eyevinn/whip-endpoint
npm install --save @eyevinn/whip-endpointCode snippet example:
import { WhipEndpoint } from "@eyevinn/whip-endpoint";
const endpoint = new WhipEndpoint({
port: 8000,
hostname: "<whiphost>",
https: false,
iceServers: [{ urls: "stun:stun.l.google.com:19302" }],
enabledWrtcPlugins: [ "sfu-broadcaster" ],
});
endpoint.setOriginSfuUrl("http://<sfu-origin>/conferences/");
endpoint.registerBroadcasterClient({
client: new BroadcasterClient("http://<wrtc-egress-endpoint>/api"),
sfuUrl: "http://<sfu-edge>/conferences/"
});
endpoint.setSfuApiKey(string | undefined);
endpoint.listen();On the egress side we also have an NPM package to start from. Currently including a plugin for the WHPP protocol and pre-built integration with Symphony Media Bridge as WebRTC SFU. We are considering including a plugin for the WHEP protocol that was introduced after we started with our prototyping.
NPM: https://www.npmjs.com/package/@eyevinn/wrtc-egress
npm install --save @eyevinn/wrtc-egressExample:
import { WHPPEndpoint, SfuType } from "@eyevinn/wrtc-egress";
const endpoint = new WHPPEndpoint({
port: 8001,
hostname: "wrtc-edge.eyevinn.technology",
prefix: "/whpp",
sfuAdapter: SfuType.smb,
sfuOptions: { smbUrl: "http://localhost:8080/conferences/", apiKey: "secret" },
iceServers: [{ urls: "stun:stun.l.google.com:19302" }],
});
endpoint.listen();All these components including a Symphony Media Bridge SFU are containerized and made available as Docker images. To setup a WHIP endpoint, origin SFU, edge SFU and egress WHPP endpoint you can use this docker-compose file as a template.
version: "3.7"services:
sfu-origin:
image: eyevinntechnology/wrtc-sfu:v0.3.0
environment:
- HTTP_PORT=8280
- UDP_PORT=13000
- IPV4_ADDR=127.0.0.1
- API_KEY=example
ports:
- "8280:8280/tcp"
- "13000:13000/udp"
sfu-edge:
image: eyevinntechnology/wrtc-sfu:v0.3.0
environment:
- HTTP_PORT=8381
- UDP_PORT=13000
- IPV4_ADDR=127.0.0.1
- API_KEY=dev
ports:
- "8081:8081/tcp"
- "13000:13000/udp"
ingest:
image: eyevinntechnology/wrtc-origin:v0.3.0
depends_on:
- sfu-origin
- sfu-edge
environment:
- PORT=8200
- EXT_PORT=8200
- ORIGIN_SFU_URL=http://sfu:8280/conferences/
- SFU_API_KEY=example
- EDGE_LIST_CONFIG=/etc/edge-list-config.json
ports:
- "8200:8200/tcp"
volumes:
- ./example-edge-list-config.json:/etc/edge-list-config.json
egress:
image: eyevinntechnology/wrtc-whpp:v0.2.0
environment:
- PORT=8300
- EXT_PORT=8300
- HOSTNAME=localhost
- SMB_URL=http://sfu-edge:8380/conferences/
- SMB_API_KEY=example
ports:
- "8300:8300/tcp"
And the example-edge-list-config.json that looks like this
[
{
"sfuApiUrl": "http://sfu-edge:8380/conferences/",
"egressApiUrl": "http://egress:8300/api"
}
]HLS Monitoring Service
Service to monitor one or more HLS streams for manifest errors and inconsistencies. Possible inconsistencies and errors are:
- Media sequence counter issues.
- Discontinuity sequence counter issues.
- Detect stale manifests. The default is at least 6000ms but can be configured via the env
HLS_MONITOR_INTERVALor set when creating a new HLSMonitor. - Playlist is updating correctly.
GitHub: https://github.com/Eyevinn/hls-monitor
Video Quality Monitor
A small package to monitor buffering and dropped frames on the video element, reporting it back as state updates into a sent in callback.
NPM: https://www.npmjs.com/package/@eyevinn/video-quality-monitor
import { VideoQualityMonitor } from "@eyevinn/video-quality-monitor";
const videoElement = document.querySelector("video");function handler = (state) => {
console.log(`state changed –>`, state);
};
new VideoQualityMonitor(videoElement, handler);
That’s all for now!
Join our community on Slack where you can post any questions regarding any of our open source projects. Eyevinn’s consulting business can also offer you:
- Further development of any of these components
- Customization and integration of any of these components into your platform
- Support and maintenance agreement
Contact sales@eyevinn.se if you are interested.
