All Projects → alfg → Docker Nginx Rtmp

alfg / Docker Nginx Rtmp

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

Projects that are alternatives of or similar to Docker Nginx Rtmp

Vidgear
A High-performance cross-platform Video Processing Python framework powerpacked with unique trailblazing features 🔥
Stars: ✭ 2,048 (+236.84%)
Mutual labels:  twitch, ffmpeg, hls, live-streaming
Rtmp Ts Dash Webrtc
👾 音视频解决方案 Audio and video solutions(AV1)
Stars: ✭ 129 (-78.78%)
Mutual labels:  ffmpeg, hls, rtmp
Live Stream From Desktop
Provide guidance to test live streaming (mpeg-dash or hls) or vod from your desktop
Stars: ✭ 124 (-79.61%)
Mutual labels:  ffmpeg, hls, live-streaming
Go Oryx
The go-oryx is SRS++, focus on real-time live streaming load-balancer.
Stars: ✭ 608 (+0%)
Mutual labels:  hls, rtmp, live-streaming
Media Server
A brpc-based server to host and proxy live streams
Stars: ✭ 175 (-71.22%)
Mutual labels:  hls, rtmp, live-streaming
Ffmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
Stars: ✭ 27,382 (+4403.62%)
Mutual labels:  ffmpeg, hls, rtmp
Ffplayout Engine
python and ffmpeg based playout
Stars: ✭ 128 (-78.95%)
Mutual labels:  ffmpeg, hls, rtmp
nott
The New OTT Platform - an excuse to discuss and design a simple edge computing platform
Stars: ✭ 46 (-92.43%)
Mutual labels:  ffmpeg, hls, live-streaming
tms
tms(toy media server) is a toy media server for myself learning media develop. Just for fun.
Stars: ✭ 29 (-95.23%)
Mutual labels:  hls, rtmp, live-streaming
smart rtmpd
RTMP server, smart, compact, high performance(c, c++), high concurrency, easy to maintain, easy to deploy, (supports multiple operating systems Windows and Linux, ARM, FreeBSD)
Stars: ✭ 159 (-73.85%)
Mutual labels:  ffmpeg, hls, rtmp
Srs
SRS is a simple, high efficiency and realtime video server, supports RTMP, WebRTC, HLS, HTTP-FLV, SRT and GB28181.
Stars: ✭ 16,734 (+2652.3%)
Mutual labels:  hls, rtmp, live-streaming
Php Practice
🌹 一天一点点,积少成多...
Stars: ✭ 351 (-42.27%)
Mutual labels:  ffmpeg, hls, rtmp
Javelin
[Mirror] RTMP streaming server written in Rust
Stars: ✭ 77 (-87.34%)
Mutual labels:  hls, rtmp, live-streaming
Abr Broadcaster
A real time encoder for Adaptive Bitrate Broadcast
Stars: ✭ 80 (-86.84%)
Mutual labels:  ffmpeg, hls, live-streaming
live-broadcast-bundle
Live broadcasting planner and scheduler
Stars: ✭ 38 (-93.75%)
Mutual labels:  twitch, ffmpeg, rtmp
Awesome Live Stream
Webrtc && Nginx && DASH && Quic 学习资料收集,持续更新中
Stars: ✭ 290 (-52.3%)
Mutual labels:  ffmpeg, hls, rtmp
Janus Webrtc Gateway Docker
Perfect Docker Image for Media Streaming Expert User ( https://github.com/meetecho/janus-gateway )
Stars: ✭ 582 (-4.28%)
Mutual labels:  ffmpeg, hls, rtmp
Livego
live video streaming server in golang
Stars: ✭ 7,312 (+1102.63%)
Mutual labels:  hls, rtmp
Awesome Video
A curated list of awesome streaming video tools, frameworks, libraries, and learning resources.
Stars: ✭ 397 (-34.7%)
Mutual labels:  ffmpeg, hls
Gohls
A server that exposes a directory for video streaming via web interface
Stars: ✭ 409 (-32.73%)
Mutual labels:  ffmpeg, hls

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.19.7 (Mainline version compiled from source)
  • nginx-rtmp-module 1.2.1 (compiled from source)
  • ffmpeg 4.3.2 (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.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.0 (Alpine 9.3.0)
  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. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].