Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
cdn [2025/01/31 01:21] – ischluff | cdn [2025/05/22 11:22] (current) – ischluff | ||
---|---|---|---|
Line 2: | Line 2: | ||
< | < | ||
- | This documentation describes our Livestreaming CDN as of 2024. | + | This documentation describes our Livestreaming CDN as of 2025. |
The File-CDN for media.ccc.de is described on [[software: | The File-CDN for media.ccc.de is described on [[software: | ||
</ | </ | ||
- | |||
- | |||
- | |||
- | == The Future of Streaming | ||
- | |||
- | For redundancy and ease of use the CDN is managed by a distributed system built on consul. | ||
- | |||
- | Damit ist es möglich redundante CDN-Master sowie redundante Ingest-Server zu betreiben und trotzdem ein Web-Backend mit allen relevanten Streaming-Infos bereitzustellen. Weiterhin könnte die Streaming-Webseite intelligent auf das Vorhandensein/ | ||
- | |||
- | Ein weiterer Vorteil des angedachten Setups sind deutlich geringere Latenz durch den fehlenden Fanout, sowie deutlich schnellere Stream-Restarts durch aktive Benachrichtigung der Transcoder. | ||
- | |||
- | === Übersicht | ||
- | {{drawio> | ||
==== Repo Links | ==== Repo Links | ||
Line 26: | Line 13: | ||
== Architecture | == Architecture | ||
- | The CDN-Cascade has 5 stages: Master-Encoder, | + | The CDN-Cascade has 6 stages: Master-Encoder, |
{{: | {{: | ||
Line 56: | Line 43: | ||
# consul kv get / | # consul kv get / | ||
myloc-transcoder3 | myloc-transcoder3 | ||
+ | |||
+ | # To reallocate a transcoder for a stuck stream | ||
+ | consul kv delete / | ||
``` | ``` | ||
Line 72: | Line 62: | ||
The edge relays run nginx with caching proxy config and upstream set to the master relay. | The edge relays run nginx with caching proxy config and upstream set to the master relay. | ||
- | == Stream-URLs | + | === 6. Loadbalancer |
+ | The end-user facing domains '' | ||
- | The resulting stream URLs are as follows: | + | ==== streaming.media.ccc.de |
+ | The load-balancers serve the [[: | ||
+ | |||
+ | ==== cdn.c3voc.de | ||
+ | Requests to '' | ||
+ | |||
+ | The relay weight distribution is stored in consul KV and can be tweaked in real time. The haproxy configs automatically get updated by consul-template after a change. | ||
+ | |||
+ | ``` | ||
+ | # Get the current weight distribution, | ||
+ | consul kv get -recurse / | ||
+ | services/ | ||
+ | services/ | ||
+ | ``` | ||
+ | |||
+ | Because of the behavior of HLS/DASH clients if a client fetches a playlist file and gets a redirect, all further requests go to the same origin. With this trick the clients stay persistently on one relay until they are redirected. | ||
+ | |||
+ | == Stream-URLs | ||
- | MPEG-DASH | + | The resulting stream URLs are as follows |
- | * http:// | + | |
- | HLS (h.264 Multi-Quality | + | HLS (H.264 multi-quality |
- | * http:// | + | * http:// |
Moar HLS | Moar HLS | ||
- | * http:// | + | |
- | * http:// | + | * http:// |
- | * http:// | + | * http:// |
- | * http:// | + | * http:// |
- | * http:// | + | * http:// |
+ | |||
+ | **Currently not active:** | ||
+ | |||
+ | MPEG-DASH (VPx multi-quality + multi-language) | ||
+ | * http:// | ||
Audio-MP3: | Audio-MP3: | ||
- | * http:// | + | * http:// |
- | * http:// | + | * http:// |
- | * http:// | + | * http:// |
Audio-Opus: | Audio-Opus: | ||
- | * http:// | + | * http:// |
- | * http:// | + | * http:// |
- | * http:// | + | * http:// |
+ | == Dynamic SRT/RTMP endpoints with RTMP Auth | ||
+ | SRT and RTMP Endpoints can be created under https:// | ||
- | == Loadbalancer | + | The RTMP-URL for the endpoint |
- | The end-user facing domains | + | |
- | === streaming.media.ccc.de | + | The SRT-URL would be : '' |
- | Unter dieser Domain liefern beide LBs unabhängig von einander die [[:software: | + | |
- | === cdn.c3voc.de | + | == Future improvements |
- | Requests to '' | + | |
- | Because | + | The diagram below shows the envisioned architecture as of 2020. In the meantime many of the improvements have been integrated into the CDN. |
+ | Some more potential improvements are as follows: | ||
+ | * Dynamically adapting the streaming-website to the existence/lack of a stream | ||
+ | * Building | ||
+ | * To gracefully shutdown | ||
+ | * Build master relay redundancy using dynamic upload client and relay upstream configuration. (Relay upstreams need to be sticky, because the HLS playlists generated | ||
+ | * Use DNS rotation on ingest | ||
+ | * Finalize srtrelay meshing to allow pushed streams to be pulled from any ingest machine. | ||
- | === Dynamic RTMP endpoints with RTMP Auth | + | {{drawio> |
- | RTMP Endpoints can be created under https:// | + | |
- | Die RTMP-Url für den endpunkt '' | ||