Restream live content as HLS using ffmpeg in Docker. This fork removes transcoding profiles and adds an audio-only option.
You need to have Docker & Docker Compose installed.
- Clone this repository:
git clone https://github.com/berkaycagir/hls-restream
cd hls-restream
- Modify
docker-compose.yml
and add your own sources:
version: "3.4"
services:
hls:
build: ./
container_name: hls
restart: always
tmpfs:
- "/var/www/html:mode=777,size=128M,uid=1000,gid=1000"
ports:
- "80:80"
environment:
SOURCES: |
# Full stream
ch1 rtsp://192.168.1.5:554/ch1
# Only audio of the stream
ch1_audio rtsp://192.168.1.5:554/ch1
ch1_hd http://192.168.1.6/stream/channelid/8967896?profile=pass
ch1_hd_audio http://192.168.1.6/stream/channelid/8967896?profile=pass
Profiles can you find in profiles/
folder.
- passthrough - default, no transcoding.
- Start docker compose (run this everytime you modify stream sources):
docker compose up -d
- Watch streams:
http://localhost/ch1.m3u8
http://localhost/ch1_audio.m3u8
http://localhost/ch1_hd_audio.m3u8
http://localhost/ch1_hd_audio.m3u8
In case of error, troubleshoot:
docker compose logs hls
docker compose exec -it hls sh -c 'cd /var/log/supervisor && /bin/bash'