Skip to content

Deploy your rtmp server (nginx-rtmp) together with RTMP & HLS players (nginx + video.js) on your domain

Notifications You must be signed in to change notification settings

jjlakis/rtmp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

RTMP-Server

Deploy your own RTMP Server (nginx-rtmp) & WEB video players (RTMP, HLS) on your domain. docker-compose setup containing:

  • nginx-rtmp - built from custom Dockerfile, based on tiangolo/nginx-rtmp-docker (basically nginx with nginx-rtmp plugin from Sergey Dryabzhinsky's fork) - acting as a RTMP server, 1935 port exposed.
  • nginx - just a nginx for WEB endpoints: Simple Flash-based RTMP & HLS players relying on video.js scripts,443 & 80 exposed, auto-redirect to HTTPS
  • certbot - for generating LE TLS certificates and dropping them automatically to the correct place

Requirements

  • VPS / local server with public IP and ports 80, 443 & 1935 accessible from public
  • you.yourdomain.com domain with DNS A record for pointing to your VPS IP
  • docker-compose installed

How to use

  1. Ensure that you have all requirements met. Check if subdomains actually points to your public IP:
$ dig +noall +answer you.yourdomain.com
you.yourdomain.com.               3600    IN      A       51.92.19.220
  1. Generate TLS certificates for your HTTP domains:
$ docker-compose run --rm --service-ports certbot certonly -d you.yourdomain.com --standalone

Note: certbot runs in stand-alone mode - it binds :80 on your system.

  1. Start servers:
docker-compose up -d nginx nginx-rtmp
  1. Now you can:
  • Stream (e.g. by OBS) to your endpoint: rtmp://you.yourdomain.com/live/<your-key> & receive RTMP signal from the same endpoint.
  • Watch your stream on Flash-based WEB RTMP player: https://you.yourdomain.com/flash
  • Watch your stream via HLS: https://hls.yourdomain.com/flash

TODOs:

  • Information in README.md when no certs needed (or exists)
  • Check directory for generated certs (certbot CLI)
  • Find some way to template domains in NGINX config
  • HLS sharing between services
  • Condition if we want to use public or local addresses (??)
  • RTMPS support (stunnel)
  • Multiple endpoints on the same VPS: starting with vhost-based rtmp endpoint
  • Helm chart

About

Deploy your rtmp server (nginx-rtmp) together with RTMP & HLS players (nginx + video.js) on your domain

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published