Skip to content

Commit 3e08ec4

Browse files
author
Jan Stabenow
committed
ADD v0.1.0-rc.4
1 parent 81fac4b commit 3e08ec4

File tree

11 files changed

+298
-115
lines changed

11 files changed

+298
-115
lines changed

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
Changes from v0.1.0-rc.3 to v0.1.0-rc.4
2+
3+
* Updates and extentions:
4+
* NGINX 1.9.9 -> 1.10.2
5+
* NGINX-RTMP -> latest Sergey-Version (fix-hls-playlist-length-on-varsize-fragments)
6+
* FFmpeg 2.8.6 -> 3.1.2
7+
* added LUAJIT and the LUA-NGINX module
8+
* added NGINX exporter (status and metrics) for [Prometheus.io](https://prometheus.io)
9+
* switched to [certbot-auto](https://certbot.eff.org/) for better Let's Encrypt workflows
10+
* removed VTS module (heavy load with hls-chunks)
11+
* removed RTMP_AUTO_PUSH function (faulty)
12+
* modified (default) env:
13+
* NEW:
14+
* PLAYER_CREATE "true"
15+
* PLAYER_WATERMARK_SOURCE "none"
16+
* PLAYER_WATERMARK_POSITION "top-right"
17+
* PLAYER_WATERMARK_LINK "none"
18+
* PLAYER_COLOR_BUTTONS "3daa48"
19+
* PLAYER_COLOR_SEEKBAR "3daa48"
20+
* PLAYER_GA_ACCOUNT "none"
21+
* PLAYER_GA_TRACKERNAME "datarheiEdge"
22+
* RENAMED:
23+
* HTTPS_CERT_DOMAIN -> HTTPS_SRV_CERT_DOMAIN
24+
* HTTPS_CERT_CREATE -> HTTPS_LETSENCRYPT
25+
* HTTPS_CERT_MAIL -> HTTPS_LETSENCRYPT_MAIL
26+
* REMOVED:
27+
* RTMP_AUTO_PUSH (faulty)
28+
129
Changes from v0.1.0-rc.2 to v0.1.0-rc.3
230

331
* enabled rtmp-stats (html/xml/json)

Dockerfile

Lines changed: 68 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
FROM debian:jessie
22

33
MAINTAINER datarhei <info@datarhei.org>
4-
5-
ENV RESTREAMER_EDGE_VERSION=0.1.0-rc.3 \
6-
FFMPEG_VERSION=2.8.6 \
4+
ENV RESTREAMER_EDGE_VERSION=0.1.0-rc.4 \
5+
FFMPEG_VERSION=3.1.2 \
76
YASM_VERSION=1.3.0 \
87
LAME_VERSION=3_99_5 \
9-
NGINX_VERSION=1.9.9 \
10-
NGINX_RTMP_VERSION=1.1.7.10 \
8+
NGINX_VERSION=1.10.2 \
9+
NGINX_RTMP_VERSION=master \
10+
NGINX_NJS=master \
11+
NGINX_DEVEL_KIT_VERSION=0.3.0 \
12+
NGINX_STUB_STATUS_PROM=master \
13+
LUA_NGINX_MODULE_VERSION=0.10.7 \
14+
LUAJIT_VERSION=2.0.4 \
15+
LUAJIT_MAJOR_VERSION=2.0 \
16+
LUAJIT_LIB=/usr/local/lib \
17+
LUAJIT_INC=/usr/local/include/luajit-2.0 \
1118

1219
SRC="/usr/local" \
1320
LD_LIBRARY_PATH="${SRC}/lib" \
@@ -16,8 +23,10 @@ ENV RESTREAMER_EDGE_VERSION=0.1.0-rc.3 \
1623
BUILDDEPS="autoconf automake gcc g++ libtool make nasm unzip zlib1g-dev libssl-dev xz-utils cmake build-essential libpcre3-dev"
1724

1825
RUN rm -rf /var/lib/apt/lists/* && \
19-
apt-get update --fix-missing && \
20-
apt-get install -y --force-yes curl git libpcre3 tar perl ca-certificates apache2-utils libaio1 libxml2 libxslt-dev ${BUILDDEPS} && \
26+
apt-get update && \
27+
apt-get install -y --force-yes --fix-missing apt-utils && \
28+
apt-get upgrade -y && \
29+
apt-get install -y --force-yes --fix-missing curl git libpcre3 tar perl ca-certificates apache2-utils libaio1 libxml2 libxslt-dev ${BUILDDEPS} && \
2130

2231
# yasm
2332
DIR="$(mktemp -d)" && cd "${DIR}" && \
@@ -62,12 +71,10 @@ RUN rm -rf /var/lib/apt/lists/* && \
6271
rm -rf "${DIR}" && \
6372

6473
# ffmpeg
65-
# patch: andrew-shulgin Ignore invalid sprop-parameter-sets missing PPS
6674
DIR="$(mktemp -d)" && cd "${DIR}" && \
6775
curl -LOks "https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz" && \
6876
tar xzvf "ffmpeg-${FFMPEG_VERSION}.tar.gz" && \
6977
cd "ffmpeg-${FFMPEG_VERSION}" && \
70-
curl -Lks "https://github.com/FFmpeg/FFmpeg/commit/1c7e2cf9d33968375ee4025d2279c937e147dae2.patch" | patch -p1 && \
7178
./configure \
7279
--prefix="${SRC}" \
7380
--bindir="${SRC}/bin" \
@@ -97,25 +104,42 @@ RUN rm -rf /var/lib/apt/lists/* && \
97104
echo "${SRC}/lib" > "/etc/ld.so.conf.d/libc.conf" && \
98105
ffmpeg -buildconf && \
99106

100-
# nginx-rtmp
107+
# LuaJIT
101108
DIR=$(mktemp -d) && cd ${DIR} && \
109+
curl -LOks "http://luajit.org/download/LuaJIT-${LUAJIT_VERSION}.zip" && \
110+
unzip LuaJIT-${LUAJIT_VERSION} && \
111+
cd LuaJIT-${LUAJIT_VERSION} && \
112+
make install && \
113+
ln -sf luajit-${LUAJIT_VERSION} /usr/local/bin/luajit && \
114+
rm -rf ${DIR}
115+
116+
# nginx-rtmp
117+
RUN DIR=$(mktemp -d) && cd ${DIR} && \
102118
curl -LOks "https://github.com/nginx/nginx/archive/release-${NGINX_VERSION}.tar.gz" && \
103119
tar xzvf "release-${NGINX_VERSION}.tar.gz" && \
104-
curl -LOks "https://github.com/sergey-dryabzhinsky/nginx-rtmp-module/archive/v${NGINX_RTMP_VERSION}.tar.gz" && \
105-
tar xzvf "v${NGINX_RTMP_VERSION}.tar.gz" && \
106-
curl -LOks https://github.com/vozlt/nginx-module-vts/archive/master.zip && \
107-
unzip master.zip && \
108-
rm master.zip && \
109-
curl -LOks https://github.com/nginx/njs/archive/master.zip && \
110-
unzip master.zip && \
111-
rm master.zip && \
120+
curl -LOks "https://github.com/sergey-dryabzhinsky/nginx-rtmp-module/archive/${NGINX_RTMP_VERSION}.tar.gz" && \
121+
tar xzvf "${NGINX_RTMP_VERSION}.tar.gz" && \
122+
curl -LOks https://github.com/nginx/njs/archive/${NGINX_NJS}.zip && \
123+
unzip ${NGINX_NJS}.zip && \
124+
curl -LOks "https://github.com/simpl/ngx_devel_kit/archive/v${NGINX_DEVEL_KIT_VERSION}.zip" -O && \
125+
unzip v${NGINX_DEVEL_KIT_VERSION}.zip && \
126+
curl -LOks "https://github.com/openresty/lua-nginx-module/archive/v${LUA_NGINX_MODULE_VERSION}.zip" && \
127+
unzip v${LUA_NGINX_MODULE_VERSION}.zip && \
128+
curl -LOks "https://github.com/mhowlett/ngx_stub_status_prometheus/archive/${NGINX_STUB_STATUS_PROM}.zip" && \
129+
unzip ${NGINX_STUB_STATUS_PROM}.zip && \
112130
cd nginx-release-${NGINX_VERSION} && \
113131
auto/configure \
114132
--with-http_ssl_module \
115133
--with-http_xslt_module \
116-
--add-module="../nginx-module-vts-master" \
117-
--add-module="../njs-master/nginx" \
118-
--add-module="../nginx-rtmp-module-${NGINX_RTMP_VERSION}" && \
134+
--with-ld-opt="-Wl,-rpath,/usr/local/lib/lua" \
135+
--with-http_ssl_module \
136+
--with-http_realip_module \
137+
--with-http_stub_status_module \
138+
--add-dynamic-module="../njs-${NGINX_NJS}/nginx" \
139+
--add-dynamic-module="../nginx-rtmp-module-${NGINX_RTMP_VERSION}" \
140+
--add-module="../ngx_devel_kit-${NGINX_DEVEL_KIT_VERSION}" \
141+
--add-module="../lua-nginx-module-${LUA_NGINX_MODULE_VERSION}" \
142+
--add-dynamic-module="../ngx_stub_status_prometheus-${NGINX_STUB_STATUS_PROM}" && \
119143
make -j"$(nproc)" && \
120144
make install && \
121145
cp ../nginx-rtmp-module-${NGINX_RTMP_VERSION}/stat.xsl /usr/local/nginx/html/info.xsl && \
@@ -127,8 +151,9 @@ RUN rm -rf /var/lib/apt/lists/* && \
127151

128152
# letsencrypt
129153
cd /opt && \
130-
git clone https://github.com/letsencrypt/letsencrypt letsencrypt && \
131-
letsencrypt/letsencrypt-auto --os-packages-only && \
154+
curl -LOks https://dl.eff.org/certbot-auto && \
155+
chmod a+x ./certbot-auto && \
156+
./certbot-auto --os-packages-only --noninteractive && \
132157

133158
# clappr-player
134159
DIR=$(mktemp -d) && cd ${DIR} && \
@@ -141,6 +166,10 @@ RUN rm -rf /var/lib/apt/lists/* && \
141166
mv * /usr/local/nginx/html && \
142167
rm -rf ${DIR} && \
143168

169+
# prometheus exporter
170+
cd /usr/local/nginx/ && \
171+
curl -LOks "https://raw.githubusercontent.com/knyar/nginx-lua-prometheus/master/prometheus.lua" && \
172+
144173
apt-get purge -y --auto-remove ${BUILDDEPS} && \
145174
apt-get clean -y && \
146175
rm -rf /var/lib/apt/lists/* \
@@ -215,8 +244,21 @@ ENV WORKER_PROCESSES=1 \
215244

216245
HTTPS_SRV=false \
217246
HTTPS_SRV_PORT=443 \
218-
HTTPS_CERT_CREATE=true \
219-
HTTPS_CERT_MAIL=admin@example.org \
220-
HTTPS_CERT_DOMAIN=example.org
247+
HTTPS_SRV_CERT_DOMAIN=example.org \
248+
249+
HTTPS_LETSENCRYPT=false \
250+
HTTPS_LETSENCRYPT_MAIL=admin@example.org \
251+
252+
PLAYER_CREATE=true \
253+
254+
PLAYER_WATERMARK_SOURCE=none \
255+
PLAYER_WATERMARK_POSITION=top-right \
256+
PLAYER_WATERMARK_LINK=none \
257+
258+
PLAYER_COLOR_BUTTONS=3daa48 \
259+
PLAYER_COLOR_SEEKBAR=3daa48 \
260+
261+
PLAYER_GA_ACCOUNT=none \
262+
PLAYER_GA_TRACKERNAME=datarheiEdge
221263

222264
CMD ["/run.sh"]

README.md

Lines changed: 53 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Currently the Restreamer-Edge is very plain and bash based application without u
1717

1818
* [NGINX](http://nginx.org/) open source web server for high traffic
1919
* [NGINX-RTMP-Module](https://github.com/arut/nginx-rtmp-module) as streaming-backend and HLS server
20-
* [NGINX virtual host traffic status module](https://github.com/vozlt/nginx-module-vts) for http/hls-stats
20+
* [NGINX Stub Status](https://github.com/mhowlett/ngx_stub_status_prometheus) for Prometheus.io
21+
* [NGINX Metrics](https://github.com/knyar/nginx-lua-prometheus) for Prometheus.io
2122
* [NJS](https://github.com/nginx/njs) for the rtmp-authentification
2223
* [Clappr-Player](https://github.com/clappr/clappr) as HLS-player to embed your stream upon your website (no Adobe Flash)
2324
* [FFmpeg](http://ffmpeg.org) to create snapshots and live-transcode (if enabled) each is pushing streams to 240p, 360p, 480p and 720p
@@ -76,19 +77,36 @@ Available profiles are: 240p, 360p, 480p, 720p and native
7677
-e "HTTP_ACCESS_LOG=/dev/stdout"
7778
```
7879

79-
#### Enable HTTPS/SSL:
80+
#### Enable HTTPS/SSL and Let's Encrypt:
8081

8182
```sh
8283
-e "HTTPS_SRV=true"
83-
-e "HTTPS_CERT_MAIL=admin@example.org"
84-
-e "HTTPS_CERT_DOMAIN=example.org,example.com"
84+
-e "HTTPS_SRV_CERT_DOMAIN=example.org,example.com"
85+
-e "HTTPS_LETSENCRYPT=true"
86+
-e "HTTPS_LETSENCRYPT_MAIL=admin@example.org"
8587
-p 443:443
8688
-v /mnt/restreamer-edge/letsencrypt:/etc/letsencrypt
8789
```
8890

8991
*Port 80/443 have to be forwarded to the Restreamer-Edge and the destination of your Domains have to be your host IP-Address!*
9092

91-
*["Error creating new cert :: Too many certificates already issued for exact set of domains"](https://community.letsencrypt.org/t/public-beta-rate-limits/4772) - use -e "HTTPS_CERT_CREATE=false" if your cert is already installed*
93+
##### To auto renew your Let's Encrypt certificat you can use cron/systemd like:
94+
95+
```sh
96+
0 0 * * * /usr/bin/docker restart restreamer-edge >/dev/null 2>&1
97+
```
98+
99+
#### Customize your Player
100+
101+
```sh
102+
-e "PLAYER_WATERMARK_SOURCE=http://datarhei.org/logo.png"
103+
-e "PLAYER_WATERMARK_POSITION=top-left"
104+
-e "PLAYER_WATERMARK_LINK=http://datarhei.org"
105+
-e "PLAYER_COLOR_BUTTONS=000000"
106+
-e "PLAYER_COLOR_SEEKBAR=000000"
107+
-e "PLAYER_GA_ACCOUNT=UE123456"
108+
-e "PLAYER_GA_TRACKERNAME=datarheiDemoEdge1"
109+
```
92110

93111
## Usage
94112

@@ -99,16 +117,20 @@ Available profiles are: 240p, 360p, 480p, 720p and native
99117
2. open the Edge-Player on your browser:
100118
http://[your-edge-ip]:[http-port]/index.html?stream=mystream
101119

102-
#### HTTP stat:
103-
104-
![VTS Stats](docs/edge-stats.png)
120+
#### NGINX-Exporter for Prometheus.io:
105121

106-
1. Open the VTS page:
122+
1. Open stauts page:
107123
http://[your-edge-ip]:[http-port]/status
108124
2. Enter your login data is set by:
109125
```-e HTTP_AUTH_USERNAME=your-username```
110126
```-e HTTP_AUTH_PASSWORD=your-password```
111127

128+
1. Open metrics page:
129+
http://[your-edge-ip]:[http-port]/metrics
130+
2. Enter your login data is set by:
131+
```-e HTTP_AUTH_USERNAME=your-username```
132+
```-e HTTP_AUTH_PASSWORD=your-password```
133+
112134
#### RTMP stat
113135

114136
1. Open "http://[your-edge-ip]:[http-port]/rtmp-stat"
@@ -124,14 +146,14 @@ Available profiles are: 240p, 360p, 480p, 720p and native
124146

125147
* NGINX [description](http://nginx.org/en/docs/ngx_core_module.html)
126148
* NGINX RTMP [description](https://github.com/sergey-dryabzhinsky/nginx-rtmp-module/blob/master/doc/directives.md)
127-
* NGINX VTS [description](https://github.com/vozlt/nginx-module-vts)
149+
* Clappr-Player [description](https://github.com/clappr/clappr/blob/master/doc/BUILTIN_PLUGINS.md)
128150

129151
#### Default values
130152

131153
```sh
132154
WORKER_PROCESSES "1"
133155
WORKER_CONNECTIONS "1024"
134-
156+
135157
RTMP_ACCESS_LOG "off"
136158

137159
RTMP_SRV_PORT "1935"
@@ -143,15 +165,15 @@ RTMP_SRV_ACK_WINDOW "5000000"
143165
RTMP_SRV_CHUNK_SIZE "4096"
144166
RTMP_SRV_MAX_MESSAGE "1M"
145167
RTMP_SRV_BUFLEN "5s"
146-
168+
147169
RTMP_SRV_APP_HLS_INTERLEAVE "on"
148170
RTMP_SRV_APP_HLS_META "copy"
149171
RTMP_SRV_APP_HLS_WAIT_KEY "on"
150172
RTMP_SRV_APP_HLS_WAIT_VIDEO "on"
151173
RTMP_SRV_APP_HLS_DROP_IDLE_PUBLISHER "10s"
152174
RTMP_SRV_APP_HLS_SYNC "10ms"
153175
RTMP_SRV_APP_HLS_IDLE_STREAMS "off"
154-
176+
155177
RTMP_SRV_APP_HLS_HLS_FRAGMENT "2s"
156178
RTMP_SRV_APP_HLS_HLS_PLAYLIST_LENGTH "60"
157179
RTMP_SRV_APP_HLS_HLS_SYNC "1ms"
@@ -164,7 +186,7 @@ RTMP_SRV_APP_HLS_HLS_FRAGMENT_SLICING "plain"
164186
RTMP_SRV_APP_HLS_HLS_TYPE "live"
165187
RTMP_SRV_APP_HLS_HLS_KEY "off"
166188
RTMP_SRV_APP_HLS_HLS_FRAGMENTS_PER_KEY "0"
167-
189+
168190
RTMP_SRV_APP_HLS_SNAPSHOT_INTERVAL "60"
169191
RTMP_SRV_APP_HLS_TRANSCODING "false"
170192
RTMP_SRV_APP_HLS_TRANSCODING_PROFILES "240p,360p,480p,720p,native"
@@ -181,12 +203,25 @@ HTTP_SRV_LOC_HLS_ACCESS_CONTROL_ALLOW_ORIGIN "*"
181203

182204
HTTP_AUTH_USERNAME "admin"
183205
HTTP_AUTH_PASSWORD "datarhei"
184-
206+
185207
HTTPS_SRV "false"
186208
HTTPS_SRV_PORT "443"
187-
HTTPS_CERT_CREATE "true"
188-
HTTPS_CERT_MAIL "admin@example.org"
189-
HTTPS_CERT_DOMAIN "example.org"
209+
HTTPS_SRV_CERT_DOMAIN "example.org"
210+
211+
HTTPS_LETSENCRYPT "false"
212+
HTTPS_LETSENCRYPT_MAIL "admin@example.org"
213+
214+
PLAYER_CREATE "true"
215+
216+
PLAYER_WATERMARK_SOURCE "none"
217+
PLAYER_WATERMARK_POSITION "top-right"
218+
PLAYER_WATERMARK_LINK "none"
219+
220+
PLAYER_COLOR_BUTTONS "3daa48"
221+
PLAYER_COLOR_SEEKBAR "3daa48"
222+
223+
PLAYER_GA_ACCOUNT "none"
224+
PLAYER_GA_TRACKERNAME "datarheiEdge"
190225
```
191226

192227
## Hosting examples

edge.env

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ RTMP_SRV_APP_HLS_HLS_KEY=off
3131
RTMP_SRV_APP_HLS_HLS_FRAGMENTS_PER_KEY=0
3232
RTMP_SRV_APP_HLS_SNAPSHOT_INTERVAL=60
3333
RTMP_SRV_APP_HLS_TRANSCODING=false
34-
RTMP_SRV_APP_HLS_TRANSCODING_PROFILES=240p,360p,480p,720p,native
34+
RTMP_SRV_APP_HLS_TRANSCODING_PROFILES=240p,360p,480p,720p,native
3535
RTMP_PUBLISH_TOKEN=datarhei
3636
HTTP_SENDFILE=on
3737
HTTP_TCP_NOPUSH=on
@@ -43,6 +43,14 @@ HTTP_AUTH_USERNAME=admin
4343
HTTP_AUTH_PASSWORD=datarhei
4444
HTTPS_SRV=false
4545
HTTPS_SRV_PORT=443
46-
HTTPS_CERT_CREATE=true
47-
HTTPS_CERT_MAIL=admin@example.org
48-
HTTPS_CERT_DOMAIN=example.org
46+
HTTPS_SRV_CERT_DOMAIN=example.org
47+
HTTPS_LETSENCRYPT=false
48+
HTTPS_LETSENCRYPT_MAIL=admin@example.org
49+
PLAYER_CREATE=false
50+
PLAYER_WATERMARK_SOURCE=none
51+
PLAYER_WATERMARK_POSITION=top-right
52+
PLAYER_WATERMARK_LINK=none
53+
PLAYER_COLOR_BUTTONS=3daa48
54+
PLAYER_COLOR_SEEKBAR=3daa48
55+
PLAYER_GA_ACCOUNT=none
56+
PLAYER_GA_TRACKERNAME=datarheiEdge

0 commit comments

Comments
 (0)