commit 3152ffacaafe8dc4cc21f46a21ee5df92c0e7cfb Author: Orne Brocaar Date: Mon Mar 9 17:40:56 2015 -0300 Initial commit. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a1cf5e6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,39 @@ +FROM ubuntu:latest + +ENV DEBIAN_FRONTEND noninteractive +ENV PATH=$PATH:/usr/local/nginx/sbin + +EXPOSE 1935 +EXPOSE 80 + +# create directories +RUN mkdir /src && mkdir /config && mkdir /logs && mkdir /data && mkdir /static + +# update and upgrade packages +RUN apt-get update && apt-get upgrade -y && apt-get clean +RUN apt-get install -y build-essential wget + +# ffmpeg +RUN apt-get install -y software-properties-common +RUN add-apt-repository ppa:mc3man/trusty-media +RUN apt-get update +RUN apt-get install -y ffmpeg + +# nginx dependencies +RUN apt-get install -y libpcre3-dev zlib1g-dev libssl-dev +RUN apt-get install -y wget + +# get nginx source +RUN cd /src && wget http://nginx.org/download/nginx-1.6.2.tar.gz && tar zxf nginx-1.6.2.tar.gz && rm nginx-1.6.2.tar.gz + +# get nginx-rtmp module +RUN cd /src && wget https://github.com/arut/nginx-rtmp-module/archive/v1.1.6.tar.gz && tar zxf v1.1.6.tar.gz && rm v1.1.6.tar.gz + +# compile nginx +RUN cd /src/nginx-1.6.2 && ./configure --add-module=/src/nginx-rtmp-module-1.1.6 --conf-path=/config/nginx.conf --error-log-path=/logs/error.log --http-log-path=/logs/access.log +RUN cd /src/nginx-1.6.2 && make && make install + +ADD nginx.conf /config/nginx.conf +ADD static /static + +CMD "nginx" diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..7a8dcf7 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,59 @@ +daemon off; + +events { + worker_connections 1024; +} + +rtmp { + server { + listen 1935; + chunk_size 4000; + + application encoder { + live on; + + exec ffmpeg -i rtmp://localhost:1935/encoder/$name + -c:a libfdk_aac -b:a 32k -c:v libx264 -b:v 128K -f flv -g 30 rtmp://localhost:1935/hls/$name_low + -c:a libfdk_aac -b:a 64k -c:v libx264 -b:v 256k -f flv -g 30 rtmp://localhost:1935/hls/$name_mid + -c:a libfdk_aac -b:a 128k -c:v libx264 -b:v 512K -f flv -g 30 rtmp://localhost:1935/hls/$name_hi; + } + + application hls { + live on; + hls on; + hls_fragment_naming system; + hls_fragment 5s; + hls_path /data/hls; + hls_nested on; + + hls_variant _low BANDWIDTH=160000; + hls_variant _mid BANDWIDTH=320000; + hls_variant _hi BANDWIDTH=640000; + } + } +} + +http { + server { + listen 80; + + location /hls { + types { + application/vnd.apple.mpegurl m3u8; + video/mp2t ts; + } + root /data; + add_header Cache-Control no-cache; + add_header Access-Control-Allow-Origin *; + } + + location /stat { + rtmp_stat all; + rtmp_stat_stylesheet static/stat.xsl; + } + + location /static { + alias /static; + } + } +} diff --git a/static/stat.xsl b/static/stat.xsl new file mode 100644 index 0000000..92d3d2b --- /dev/null +++ b/static/stat.xsl @@ -0,0 +1,355 @@ + + + + + + + + + + + + + RTMP statistics + + + +
+ Generated by + nginx-rtmp-module , + nginx , + pid , + built   + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RTMP#clientsVideoAudioIn bytesOut bytesIn bits/sOut bits/sStateTime
Accepted: codecbits/ssizefpscodecbits/sfreqchan + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + live streams + + + + + + + + + + + + vod streams + + + + + + + + + + + + + #cccccc + #dddddd + + + + + + var d=document.getElementById('-'); + d.style.display=d.style.display=='none'?'':'none'; + return false + + + + [EMPTY] + + + + + +    + + + + + + + + + + + + + + + +   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + +
IdStateAddressFlash versionPage URLSWF URLDroppedTimestampA-VTime
+ + +
+ + + + + + + + + + + d + + + + h + + + + m + + + s + + + + + + + + + + + + + T + + + G + + + M + + K + + + + b + B + + /s + + + + + + active + idle + + + + + + + publishing + playing + + + + + + + + + #cccccc + #eeeeee + + + + + + + + http://apps.db.ripe.net/search/query.html?searchtext= + + whois + + + + + + + + + + + + + + + + + + + + + + + + + + publishing + + + + active + + + + x + + +
\ No newline at end of file