Building an Open-Source based audio streaming platform Maxime - - PowerPoint PPT Presentation

building an open source based audio streaming platform
SMART_READER_LITE
LIVE PREVIEW

Building an Open-Source based audio streaming platform Maxime - - PowerPoint PPT Presentation

Building an Open-Source based audio streaming platform Maxime Bugeia 2 February 2020 We stream audio! 2 French public broadcasting service 6 national channels 47 local channels 23 music webradios 2 Million listeners per day 200k


slide-1
SLIDE 1

Building an Open-Source based audio streaming platform

Maxime Bugeia

2 February 2020

slide-2
SLIDE 2

2

We stream audio!

slide-3
SLIDE 3

3

French public broadcasting service

6 national channels 47 local channels 23 music webradios 2 Million listeners per day 200k simultaneous listeners

slide-4
SLIDE 4

4

Before

Black Box 3rd party Icecast

slide-5
SLIDE 5

5

After

Icecast HLS Our own cloud and

  • pen source based

infrastructure

slide-6
SLIDE 6

6

Audio streaming

ICECAST

Streaming server Master/Relay Architecture Single bitrate No cache

HLS

Segmented audio/video files Sliding Playlist (m3u8) Adaptive bitrate Better mobile experience Cacheable content

Just “static” files Long persistent TCP connections

slide-7
SLIDE 7

Getting audio to the cloud

7

Audio to listeners

slide-8
SLIDE 8

Getting audio to the cloud

8

Audio to listeners

Producing stream formats Icecast HLS

slide-9
SLIDE 9

Getting audio to the cloud Deliver content to listeners

9

Audio to listeners

Producing stream formats

CDN

Icecast HLS

slide-10
SLIDE 10

Getting audio to the cloud Deliver content to listeners

10

Audio to listeners

Producing stream formats

CDN

Operate the platform Icecast HLS

slide-11
SLIDE 11

11

Getting audio to the cloud!

slide-12
SLIDE 12

LOCAL CHANNELS WEBRADIOS NATIONAL CHANNELS WAN

12 MULTICAST

Transport: multicast problem

DIRECT CONNECT

slide-13
SLIDE 13

LOCAL CHANNELS WEBRADIOS NATIONAL CHANNELS WAN

13 MULTICAST

Transport: multicast problem

?

DIRECT CONNECT

slide-14
SLIDE 14

LOCAL CHANNELS WEBRADIOS NATIONAL CHANNELS WAN

14 MULTICAST

Transport: multicast problem

?

No multicast in AWS!

DIRECT CONNECT

slide-15
SLIDE 15

15

Transport: SRT to the rescue

slide-16
SLIDE 16

LOCAL CHANNELS WEBRADIOS NATIONAL CHANNELS WAN

16 MULTICAST

Transport: to the cloud!

DIRECT CONNECT

slide-17
SLIDE 17

17

SRT CALLER 1 SRT CALLER 2 SRT LISTENER 1 SRT LISTENER 2

m a i n backup m a i n backup

5 inputs per channel

Transport: resiliency

b a c k u p s a t b a c k u p s a t

slide-18
SLIDE 18

18

Audio to cloud

DIRECT CONNECT SAT BACKUP

slide-19
SLIDE 19

19

Producing stream formats!

slide-20
SLIDE 20

20

Liquidsoap

Open Source Audio & Video Streaming Language Collaboration with Radio France

One program to rule them all

Receive Transcode Control

SRT listener Output AAC Output MP3 Produce HLS Produce Icecast Switch between sources Fallback logic Expose metrics

slide-21
SLIDE 21

21

Producing the streams

DIRECT CONNECT SAT BACKUP

Icecast

Transcoder Liquidsoap

HLS

slide-22
SLIDE 22

22

Liquidsoap Icecast Master Nginx Icecast stream HLS stream Icecast stream

Transcoder Architecture

HLS files

slide-23
SLIDE 23

Radio as Code

23

Define inputs

slide-24
SLIDE 24

Radio as Code

24

Live: what we want to play

slide-25
SLIDE 25

Radio as Code

25

Fallback logic

slide-26
SLIDE 26

Radio as Code

26

Fallback logic

Never fail!

slide-27
SLIDE 27

27

Output HLS

Radio as Code

Source that never fails

slide-28
SLIDE 28

28

Output HLS

Radio as Code

slide-29
SLIDE 29

29

Output HLS

Radio as Code

slide-30
SLIDE 30

30

Output Icecast

Radio as Code

Source that never fails

slide-31
SLIDE 31

31

Liquidsoap Icecast Master HLS files live.m3u8 live_hifi.m3u8 segment1.ts segmentxxx.ts

Transcoders Architecture

HLS stream Nginx Icecast stream Icecast stream

slide-32
SLIDE 32

32

Scaling to 200k listeners!

slide-33
SLIDE 33

33

https://icecast.radiofrance.fr/fip-hifi.aac

Icecast Master

HTTP :80 HTTPS :443

Scale: Icecast

Transcoder 1 Transcoder 2 Icecast Relay 1 Icecast Relay 2 Icecast Relay X

AWS NLB

Icecast Relay

slide-34
SLIDE 34

34

https://icecast.radiofrance.fr/fip-hifi.aac

Icecast Master

HTTP :80 HTTPS :443

Scale: Icecast

Transcoder 1 Transcoder 2 Icecast Relay 1 Icecast Relay 2 Icecast Relay X

AWS NLB

Icecast Relay

No cache No autoscaling Icecast Relay automatic fallback

slide-35
SLIDE 35

35

HLS base stream

Scale: HLS

CDN

Cache layer

Transcoder 1 Transcoder 2 Varnish 1 Varnish 2 Varnish X

AWS NLB https://stream.radiofrance.fr/fip/fip.m3u8 https://stream.radiofrance.fr/fip/fip_hifi.m3u8 fip_aac_hifi_2_301960_1579533023.ts Segments Playlists

slide-36
SLIDE 36

36

HLS base stream

Scale: HLS

CDN

Cache layer

Transcoder 1 Transcoder 2 Varnish 1 Varnish 2 Varnish X

AWS NLB https://stream.radiofrance.fr/fip/fip.m3u8 https://stream.radiofrance.fr/fip/fip_hifi.m3u8 fip_aac_hifi_2_301960_1579533023.ts Segments Playlists

Autoscaling at cache layer CDN level fallback possible

slide-37
SLIDE 37

37

HLS base stream

Scale: HLS

CDN

Cache layer

Transcoder 1 Transcoder 2 Varnish 1 Varnish 2 Varnish X

AWS NLB https://stream.radiofrance.fr/fip/fip.m3u8 https://stream.radiofrance.fr/fip/fip_hifi.m3u8 fip_aac_hifi_2_301960_1579533023.ts Segments Playlists

Just like web!

slide-38
SLIDE 38

38

Operate

slide-39
SLIDE 39

39

Liquidsoap Icecast Master Nginx Icecast stream HLS stream Icecast stream

Transcoder Architecture

HLS files

slide-40
SLIDE 40

40

Liquidsoap Icecast Master Nginx Liquidsoap xxxx Icecast stream HLS stream Icecast stream

Transcoder Architecture

One Liquidsoap per channel

HLS files Liquidsoap xxxx Liquidsoap xxxx Liquidsoap xxxx Liquidsoap xxxx Liquidsoap xxxx

slide-41
SLIDE 41

Automate

41

Declarative everything Generating:

  • SRT callers
  • Liquidsoap scripts
  • Icecast master & relay conf
slide-42
SLIDE 42

42

Monitor

Visualize Collect Export metrics

Node Exporter Liquidsoap Icecast exporter

slide-43
SLIDE 43

43

Monitor

slide-44
SLIDE 44

44

HLS access logs HTTP POST Json Custom logs Ingester HLS Icecast

Monitor: real time listeners

Icecast prometheus Exporter

slide-45
SLIDE 45

45

Monitor

slide-46
SLIDE 46

46

Learn more

https://github.com/mbugeia/srt2hls Receive SRT stream Produce HLS Prometheus Metrics HTTP API Command and fallback logic https://github.com/Haivision/srt https://www.liquidsoap.info/

slide-47
SLIDE 47

47

Special thanks to the Liquidsoap team! https://www.liquidsoap.info/

Learn more

slide-48
SLIDE 48

For internal use only / prepared with love

Questions?

slide-49
SLIDE 49

For internal use only / prepared with love

slide-50
SLIDE 50

50

HLS / DASH Compatibility

slide-51
SLIDE 51

51

mp3 / aac Compatibility

slide-52
SLIDE 52

52

  • gg / flac Compatibility
slide-53
SLIDE 53

53

N L B Transcoders Segments HLS HTTP POST Segment Forwarder Storekeeper PGM PostgreSQL Bus RabbitMQ Cluster Kubernetes Segment .ts Playlists .m3u8 Player

Real HLS diffusion