Warning
This repository and associated container images are for demo purposes only.
Please refer to our Installation documentation on how to install Unified Origin on your desired operating system and architecture where addition configuration options maybe required.
This project demonstrates the use of FFmpeg and Unified Streaming - Origin Live to present a Live Adaptive Bitrate presentation.
FFMPEG delivers CMAF tracks to Unified Origin using the DASH-IF Live Media Ingest Protocol - Interface 1
The 2x FFmpeg containers send synchronized Video & Audio fragments to Unified Origin. To achieve this, each encoder using its internal system clock (UTC) as reference stamps the fragment with a decode time offset based upon the same algorithm (UTC + Time Scale x Sample Duration).
The default track configuration created is below, however encoding parameters can be updated within the ffmpeg/entrypoint.py.
- Video Track 1 - 1280x720 500k AVC 48GOP@25FPS
- Video Track 2 - 640x360 300k AVC 48GOP@25FPS
- Audio Track 1 - 64kbps 48kHz AAC-LC - English language
- Audio Track 2 - 64kbps 48kHz AAC-LC - Dutch language
This demo utilises software which is still in development and is therefore not intended for production use. A list of known issues affecting this demo can be tracked here.
Docker, if not already installed see: https://docs.docker.com/get-docker/
Internet access on host through ports 53 and 80; needed to check license key
Start by cloning the Live streaming trial from GitHub and starting the Docker Compose stack:
git clone https://github.com/unifiedstreaming/live-demo-cmaf.git
cd live-demo-cmaf
export UspLicenseKey=<your_license_key>
docker compose up -d
Wait for all the Docker images to build and services to start, you can view the status by checking the logs with:
docker compose logs
And checking the origin is available by querying it with curl:
curl http://localhost/channel1/channel1.isml/state
Which should respond:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Unified Streaming Platform (version=1.15.5-31515) -->
<smil
xmlns="http://www.w3.org/2001/SMIL20/Language">
<head>
<meta
name="updated"
content="2025-04-16T14:47:11.238512Z">
</meta>
<meta
name="state"
content="started">
</meta>
</head>
</smil>
Play the live stream from host running container:
- Open DASH stream (http://localhost/channel1/channel1.isml/.mpd) in latest shaka player
- Open HLS TS stream (http://localhost/channel1/channel1.isml/.m3u8) in latest hls.js
- Open HLS CMAF stream (http://localhost/channel1/channel1.isml/.m3u8?hls_fmp4) in latest hls.js
NOTE: The FFmpeg container is configured to encode multiple video and audio tracks in realtime. Therefore buffering or stalled experienced when playing the stream from Unified Origin is subject to the performance of the FFmpeg container. If issues persists, please follow step 4.
Stop the services by running:
docker compose down
To check when your license key expires:
docker exec -it live-demo-cmaf-live-origin-1 mp4split
--show_license
To print and tail origin container's logs:
docker logs -f live-demo-cmaf-live-origin-1
To get into origin container's shell:
docker exec -it -w /var/www/unified-origin live-demo-cmaf-live-origin-1 /bin/sh
Learn more about the key features and benefits of using Unified Origin for live streaming
or
Contact us to purchase a license
Watching the stream can be done using your player of choice, for example FFplay.
#!/bin/sh
ffplay http://localhost/channel1/channel1.isml/.m3u8
And it should look something like: