Skip to content

Docker image for video streaming server that supports RTMP, HLS, and DASH streams.

Notifications You must be signed in to change notification settings

andriesbron/docker-stream-server

 
 

Repository files navigation

Docker + Nginx + RTMP

A Dockerfile installing NGINX, nginx-rtmp-module and FFmpeg from source with default settings for HLS live streaming. Built on Alpine Linux.

  • Nginx 1.27.0 (Stable version compiled from source)
  • nginx-rtmp-module 1.2.2 (compiled from source)
  • ffmpeg 7.0 (compiled from source)
  • Default HLS settings (See: nginx.conf)

Originally forked from https://github.com/codions/docker-stream-server, this version contains newer Nginx and Ffmpeg 🙇 versions. Under the hood, still has the ability to support S3FS, however, currently is broken, see the Docker file for my struggles of installing the requirements for S3FS support. If you don't need S3FS support, you are good to go.

Usage

Run container with local storage:

docker compose up --build

Stream live content to:

rtmp://<server ip>:1935/stream/$STREAM_NAME

OBS Configuration

  • Stream Type: Custom Streaming Server
  • URL: rtmp://localhost:1935/stream
  • Example Stream Key: hello

Watch Stream using Local Storage

  • Load up the example hls.js player in your browser:
http://localhost:8080/player.html?url=http://localhost:8080/live/hello.m3u8
  • Or in Safari, VLC or any HLS player, open:
http://localhost:8080/live/$STREAM_NAME.m3u8
  • Example Playlist: http://localhost:8080/live/hello.m3u8
  • HLS.js Player
  • FFplay: ffplay -fflags nobuffer rtmp://localhost:1935/stream/hello

SSL

To enable SSL, see nginx.conf and uncomment the lines:

listen 443 ssl;
ssl_certificate     /opt/certs/example.com.crt;
ssl_certificate_key /opt/certs/example.com.key;

This will enable HTTPS using a self-signed certificate supplied in /certs. If you wish to use HTTPS, it is highly recommended to obtain your own certificates and update the ssl_certificate and ssl_certificate_key paths.

Credits

Resources

About

Docker image for video streaming server that supports RTMP, HLS, and DASH streams.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • XSLT 59.6%
  • Dockerfile 23.8%
  • Shell 10.6%
  • HTML 6.0%