From ae84ecce49293d2410f2b3305702a49b7f7d8bed Mon Sep 17 00:00:00 2001 From: Jason Rivers Date: Fri, 29 Apr 2016 16:17:37 +0100 Subject: [PATCH] Enable HLS video via /hls on HTTP --- README.md | 5 ++++- nginx.conf | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index aba2cc1..6ccdda9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Docker-nginx-rtmp -Docker image for an RTMP server running on nginx +Docker image for an RTMP/HLS server running on nginx NGINX Version 1.9.15 nginx-rtmp-module Version 1.1.7 @@ -7,6 +7,8 @@ nginx-rtmp-module Version 1.1.7 ### Configurations This image exposes port 1935 for RTMP Steams and has 2 channels open "live" and "testing". +Live is also accessable via HLS on port 8080 + It also exposes 8080 so you can access http://:8080/stat to see the streaming statistics. The configuration file is in /opt/nginx/conf/ @@ -30,6 +32,7 @@ Play Path/Stream Key: mystream In your favorite RTMP video player connect to the stream using the URL: rtmp://<your server ip>/live/mystream +http://<your server ip>/hls/mystream.m3u8 ### Tested players * VLC diff --git a/nginx.conf b/nginx.conf index df4b848..f90f459 100644 --- a/nginx.conf +++ b/nginx.conf @@ -16,6 +16,15 @@ http { listen 8080; server_name localhost; + location /hls { + types { + application/vnd.apple.mpegurl m3u8; + video/mp2t ts; + } + root /tmp; + add_header Cache-Control no-cache; + } + location /on_publish { return 201; } @@ -49,6 +58,8 @@ rtmp { live on; record off; on_publish http://localhost:8080/on_publish; + hls on; + hls_path /tmp/hls; } application testing { live on;