Skip to content

Docker image with Nginx using the nginx-rtmp-module and hls vjs for live multimedia (video) streaming.

License

Notifications You must be signed in to change notification settings

MinerBigWhale/nginx-rtmp-hls-docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nginx-rtmp

Docker image with Nginx using the nginx-rtmp-module module for live video streaming with hls player

Description

This Docker image can be used to create an RTMP server for multimedia / video streaming using Nginx and nginx-rtmp-module, built from the current latest sources (Nginx 1.24.0 and nginx-rtmp-module 1.2.2).

This was inspired by other similar previous images from tiangolo The main purpose (and test case) to build it was to allow streaming from OBS Studio to different clients at the same time.

Docker Hub image: https://hub.docker.com/r/minerbigwhale/nginx-rtmp-hls

Details

How to use

  • For the simplest case, just run a container with this image:
docker run -d -p 1935:1935 -p 8080:8080 minerbigwhale/nginx-rtmp-hls

How to test with OBS Studio and VLC

  • Run a container with the command above

  • Open OBS Studio

  • Click the "Settings" button

  • Go to the "Stream" section

  • In "Stream Type" select "Custom Streaming Server"

  • In the "URL" enter the rtmp://<ip_of_host>/live replacing <ip_of_host> with the IP of the host in which the container is running. For example: rtmp://192.168.0.30/live

  • In the "Stream key" use stream

  • Click the "OK" button

  • In the section "Sources" click the "Add" button (+) and select a source (for example "Screen Capture") and configure it as you need

  • Click the "Start Streaming" button

  • Open a VLC player

  • Click in the "Media" menu

  • Click in "Open Network Stream"

  • Enter the URL from above as rtmp://<ip_of_host>/live/<key> replacing <ip_of_host> with the IP of the host in which the container is running and <key> with the key you created in OBS Studio. For example: rtmp://192.168.0.30/live/stream

  • Click "Play"

  • Now VLC should start playing whatever you are transmitting from OBS Studio

  • Open an internet Browser

  • in the address bar, enter http://<ip_of_host>:8080/index.html

  • the hls player should start playing the stream

  • Note that by default, index.html try to open stream.m3u8 for the key stream

  • to enable more stream keys, duplicate /srv/www/index.html and modify line 16 to match your key

License

This project is licensed under the terms of the MIT License.

About

Docker image with Nginx using the nginx-rtmp-module and hls vjs for live multimedia (video) streaming.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dockerfile 66.2%
  • HTML 19.9%
  • Shell 13.9%