• Stars
    star
    984
  • Rank 46,335 (Top 1.0 %)
  • Language XSLT
  • License
    MIT License
  • Created almost 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🐋 A Dockerfile for nginx-rtmp-module + FFmpeg from source with basic settings for streaming HLS. Built on Alpine Linux.

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.23.1 (Mainline version compiled from source)
  • nginx-rtmp-module 1.2.2 (compiled from source)
  • ffmpeg 5.1 (compiled from source)
  • Default HLS settings (See: nginx.conf)

Docker Stars Docker Pulls Docker Automated build Build Status

Usage

Server

  • Pull docker image and run:
docker pull alfg/nginx-rtmp
docker run -it -p 1935:1935 -p 8080:80 --rm alfg/nginx-rtmp

or

  • Build and run container from source:
docker build -t nginx-rtmp .
docker run -it -p 1935:1935 -p 8080:80 --rm nginx-rtmp
  • Stream live content to:
rtmp://localhost:1935/stream/$STREAM_NAME

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.

I recommend using Certbot from Let's Encrypt.

Environment Variables

This Docker image uses envsubst for environment variable substitution. You can define additional environment variables in nginx.conf as ${var} and pass them in your docker-compose file or docker command.

Custom nginx.conf

If you wish to use your own nginx.conf, mount it as a volume in your docker-compose or docker command as nginx.conf.template:

volumes:
  - ./nginx.conf:/etc/nginx/nginx.conf.template

OBS Configuration

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

Watch Stream

  • 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

FFmpeg Build

$ ffmpeg -buildconf

ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.2.1 (Alpine 10.2.1_pre1) 20201203
  configuration: --prefix=/usr/local --enable-version3 --enable-gpl --enable-nonfree --enable-small --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libvpx --enable-libtheora --enable-libvorbis --enable-libopus --enable-libfdk-aac --enable-libass --enable-libwebp --enable-postproc --enable-avresample --enable-libfreetype --enable-openssl --disable-debug --disable-doc --disable-ffplay --extra-libs='-lpthread -lm'
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100

  configuration:
    --prefix=/usr/local
    --enable-version3
    --enable-gpl
    --enable-nonfree
    --enable-small
    --enable-libmp3lame
    --enable-libx264
    --enable-libx265
    --enable-libvpx
    --enable-libtheora
    --enable-libvorbis
    --enable-libopus
    --enable-libfdk-aac
    --enable-libass
    --enable-libwebp
    --enable-postproc
    --enable-avresample
    --enable-libfreetype
    --enable-openssl
    --disable-debug
    --disable-doc
    --disable-ffplay
    --extra-libs='-lpthread -lm'

FFmpeg Hardware Acceleration

A Dockerfile.cuda image is available to enable FFmpeg hardware acceleration via the NVIDIA's CUDA.

Use the tag: alfg/nginx-rtmp:cuda:

docker run -it -p 1935:1935 -p 8080:80 --rm alfg/nginx-rtmp:cuda

You must have a supported platform and driver to run this image.

*This image is experimental!

Resources

More Repositories

1

ffmpeg-commander

🛠️ FFmpeg Command Generator Web UI
Vue
554
star
2

ping.js

🔔 Ping the web with Javascript.
JavaScript
387
star
3

opendrinks

🍸 Open Source Drinks! Add your own recipe in a pull request! Inspired by 🎃Hacktoberfest!
JavaScript
342
star
4

mp4-rust

MP4 reader + writer library in Rust! 🎥🦀
Rust
217
star
5

overwatch-api

🌎 An Unofficial Overwatch HTTP API
JavaScript
140
star
6

ffprobe-wasm

A Web-based FFProbe. Powered by FFmpeg, Vue and Web Assembly!
Vue
116
star
7

openencoder

🎥 Cloud Encoding Platform for FFmpeg.
Go
110
star
8

mp4

🎥 Basic MP4 reader in Go! CLI + Golang Package for ISO/IEC 14496-12 - ISO Base Media File Format
Go
105
star
9

dropdot

☁️ Direct Upload to Amazon S3 With CORS demo. Built with Node/Express
JavaScript
86
star
10

docker-ffmpeg

A Dockerfile FFmpeg from source. Built on Alpine Linux.
Dockerfile
80
star
11

murmur-rest

🎧 A RESTful API for administering virtual Mumble servers. Built with Flask and Ice.
Slice
78
star
12

widevine

Golang Client for Widevine Cloud
Go
64
star
13

ffmpegd

FFmpeg websocket server for ffmpeg-commander.
Go
58
star
14

guildbit

🔉 Mumble Hosting Platform
HTML
53
star
15

blockchain

💰 Go (golang) Client for the Blockchain.info API
Go
45
star
16

docker-nginx-vod-module

A Dockerized NGINX build of the nginx-vod-module
Python
36
star
17

jot

📝 A server-less pastebin app for short messages. Data is stored within the URL.
JavaScript
36
star
18

chathub-client

:octocat: 💬 Chatrooms for your Github Projects
CSS
33
star
19

AdminCraft

🌲 Admin Web GUI Server Wrapper for Vanilla Minecraft Servers
Python
29
star
20

mp4-inspector

A Web-based MP4 File Inspector. Powered by Rust, Vue and Web Assembly! 🦀
Vue
26
star
21

hyperterm-retro

◼️ A retro HyperTerm theme inspired by the cool-retro-term terminal emulator.
JavaScript
25
star
22

quick-dive-into-mp4

🎥 A technical intro the MP4 container byte structure.
Go
25
star
23

somafm

📻 A SomaFM Desktop Player
JavaScript
23
star
24

mumble-widget

🔋 A web-based channel viewer widget to display active users on your Mumble server.
JavaScript
22
star
25

PlaylistParty

📺 Play Spotify Playlists on Youtube.
JavaScript
21
star
26

mediacast

📺 Google Cast - Chrome Sender & CAF Player for testing Media Playback
Vue
20
star
27

srv

▼ A modern, opinionated and simple microservices stack built on Express.
JavaScript
17
star
28

ffmpeg-webassembly-example

FFmpeg + WebAssembly
Dockerfile
17
star
29

abr-player

📼 Adaptive Streaming Test Player
Vue
15
star
30

filtergrapher

FFmpeg filtergraph editor in the browser. Powered by libavfilter, Vue and Web Assembly!
C++
15
star
31

awesome-discord

🎮 All Things Discord
15
star
32

peerfm

🎵 A Streaming Torrent Desktop Music Player
JavaScript
14
star
33

asciicat

😸 A Simple Image to ASCII Art Conversion Tool.
Go
13
star
34

docker-bento4

A dockerized Bento4 from source. Built on Alpine Linux.
Dockerfile
11
star
35

bithook

💰 A Bitcoin Webhook CLI
Go
9
star
36

flask-bootstrap

A Flask template with Flask-SQLAlchemy support and Twitter Bootstrap frontend.
JavaScript
8
star
37

screenchop

🎮 A screenshot sharing webapp for gamers
JavaScript
7
star
38

chathub-server

:octocat: 💬 Chatrooms for Github. Express/Socket.io/OAuth proxy server.
JavaScript
5
star
39

pbm-viewer

PBM, PGM, and PPM Web Viewer
JavaScript
5
star
40

shamebell-bot

🔔 Shame your friends in Discord for doing stupid things.
JavaScript
4
star
41

libav-examples

Collection of FFmpeg libav examples.
C
4
star
42

docker-murmur

A Dockerfile with Mumble Server (murmur) built from source with gRPC support enabled
CMake
4
star
43

now-playing

🎵 Display your current playing track for your stream!
Vue
3
star
44

bifextract

CLI utility for extracting images from a BIF file
Go
3
star
45

grunt-frontend-starter

A frontend starter template built with Grunt.js and Foundation.
CSS
3
star
46

docker-php-apache

A Dockerfile installing Apache 2.4, mod_php with a default settings template. Built on Alpine Linux.
Dockerfile
3
star
47

tera-query

A screen-scraping python script to query TERA item databases from the command line.
Python
2
star
48

alfg.github.io

SCSS
2
star
49

PubChem.NET

.NET Wrapper for the PubChem PUG REST API
C#
2
star
50

jquery-btc

💰 Convert USD to realtime BTC in jQuery.
JavaScript
2
star
51

restful-markdown

📝 A simple style-guide for building RESTful documentation in Markdown.
2
star
52

golang-setup

Golang Quick Start & Developer Setup for OSX
2
star
53

dotfiles

My dotfiles to share.
Vim Script
1
star
54

zedhunt

:goberserk: A squad matchmaking platform for DayZ
JavaScript
1
star
55

alfg

1
star
56

node-web-starter

Node Web Starter with ES6, Babel, WebPack.
JavaScript
1
star
57

docker-httpd

A Dockerfile installing Apache HTTPD 2.4 from source. Built on Alpine Linux.
Dockerfile
1
star
58

scripts

My scripts to share.
Shell
1
star
59

homebrew-tap

My Homebrew Tap! 🍺
Ruby
1
star
60

terabot

An IRC bot with with TeraTome querying capabilities.
Python
1
star
61

docker-YOURLS

A Dockerfile installing YOURLS running on Apache 2.4 from source. Built on Alpine Linux.
PHP
1
star
62

flask-conditional

Conditional decorators for Flask routes.
Python
1
star
63

postpress

A job posting web application to integrate into your website.
JavaScript
1
star
64

s3-uploader

A Simple S3 Uploader in Flask.
Python
1
star
65

inviteme

A small Flask app to accept email POST requests and stores to database
Python
1
star