Simple audio HLS streaming server.
The goal of this program is to receive an audio stream with SRT and broadcast it with HLS. It can serve as a CDN origin server or as a set-and-forget streaming server.
srt2hls use Liquidsoap to receive a stream and encode it in HLS, then it use [nginx] (https://www.nginx.com/) to serve HLS content.
The Liquidsoap container, by default, run radio/live.liq script. It's a fully functionnal example that will :
- Receive an SRT input on port 10000
- Encode it in aac with 3 quality
- Segment it in HLS format in /hls directory
The Nginx container come with a specific configuration to serve HLS content with proper Content-Type, CORS and Cache-Control headers. It need read only access to /hls directory to serve HLS segments and playlists.
mkdir hls
chown -R 2001:2000 hls
sudo docker-compose up
Liquidsoap 1.4.0+ (not released yet, use master)
ffmpeg compiled with fdkaac support (the one on liquidsoap debian/ubuntu repository is fine)
By default the encoder send blank HLS segments, that mean if it's started, you can already listen the blank stream.
ffplay http://127.0.0.1:8080/live.m3u8
vlc http://127.0.0.1:8080/live.m3u8
Requirement : ffmpeg compiled with srt support (the one on liquidsoap debian/ubuntu repository is fine)
# static file
ffmpeg -re -i $AUDIOFILE -vn -f wav -codec:a pcm_s16le srt://127.0.0.1:10000
# live stream
ffmpeg -i $LIVESTREAM -vn -f wav -codec:a pcm_s16le srt://127.0.0.1:10000
sudo docker-compose build