Skip to content

Commit

Permalink
Merge branch '0.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ioppermann committed Nov 10, 2018
2 parents af70418 + 3051db8 commit 0930b01
Show file tree
Hide file tree
Showing 38 changed files with 9,512 additions and 1,123 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Dockerfile
Dockerfile_armv6l
Dockerfile_armv7l
Dockerfile-armhf
Dockerfile-aarch64
.git
.editorconfig
.gitignore
Expand All @@ -12,3 +14,4 @@ bin
db
src/webserver/public/libs
checkDeployment.sh
*.log
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
## Changes from 0.1.0-rc7 to 0.1.0

* Update FFmpeg to 4.1
* Update NGINX to 1.14.1
* Update NGINXRTMP module to 1.2.1
* Update node.js to 10.13.0
* Update NPM packages
* Fix detection of public IP
* Disable FFmpeg error detection for a VLC-like behaviour
* Add optional RTMP (RS_TOKEN environment variable) token authentification
* Add health check to NGINX
* Allow HTTP/HTTPS (HLS) and RTMPT/RTMPS addresses as video source
* Add optional autostart for the player
* Add Spanish translation for the GUI
* Add aarch64/arm64v8 Dockerfile
* Reduce docker image size
* Fix snapshot interval parsing
* Allow to disable snapshot
* Remove stream connection retry limits
* Add stale stream detection with automatic restart
* Add RS_DEBUG environment variable to store debug output to /debug
* Add RS_AUDIO environment variable to control audio processing
* Redesign logging output and logging messages
* Rename environment variables (old environment variables are still supported but will be deprecated in the future)
* RS_NODE_PORT to RS_NODEJS_PORT
* RS_NODE_ENV to RS_NODEJS_ENV
* RS_LOGGER_LEVEL to RS_LOGLEVEL
* MODE to RS_MDOE
* RS_SNAPSHOT_REFRESH_INTERVAL to RS_SNAPSHOT_INTERVAL
* Add options to control Raspberry Pi cameras (RS_MODE=RASPICAM)
* Add options to control USB cameras (RS_MODE=USBCAM)

## Changes from 0.1.0-rc7 to 0.1.0-rc.7.1

* fixed Kitematic auth failure
Expand Down
218 changes: 120 additions & 98 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,128 +1,149 @@
FROM node:5.9.0-slim
ARG IMAGE=amd64/debian:stretch-slim

MAINTAINER datarhei <info@datarhei.org>

ENV FFMPEG_VERSION=2.8.6 \
YASM_VERSION=1.3.0 \
LAME_VERSION=3_99_5 \
NGINX_VERSION=1.9.9 \
NGINX_RTMP_VERSION=1.1.7.10 \
FROM $IMAGE as builder

SRC="/usr/local"
MAINTAINER datarhei <info@datarhei.org>

ENV LD_LIBRARY_PATH="${SRC}/lib" \
PKG_CONFIG_PATH="${SRC}/lib/pkgconfig" \
ARG NASM_VERSION=2.13.03
ARG LAME_VERSION=3.100
# x264 versions from August 2018 onward (> Core 152) seem to have a bug that cuts performance by 50%
ARG X264_VERSION=20180717-2245-stable
ARG FFMPEG_VERSION=4.1
ARG NGINX_VERSION=1.14.1
ARG NGINXRTMP_VERSION=1.2.1
ARG NODE_VERSION=10.13.0

BUILDDEPS="autoconf automake gcc g++ libtool make nasm zlib1g-dev libssl-dev xz-utils cmake build-essential libpcre3-dev"
ENV SRC="/usr/local/" \
LD_LIBRARY_PATH="/usr/local/lib" \
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes curl git libpcre3 tar perl ca-certificates ${BUILDDEPS} && \
rm -rf /var/lib/apt/lists/* && \

# yasm
DIR="$(mktemp -d)" && cd "${DIR}" && \
curl -LOks "https://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz" && \
tar xzvf "yasm-${YASM_VERSION}.tar.gz" && \
cd "yasm-${YASM_VERSION}" && \
apt-get install -y \
pkg-config \
curl \
libpcre3-dev \
libtool \
libssl-dev \
zlib1g-dev \
libasound2-dev \
build-essential

# nasm
RUN mkdir -p /dist && cd /dist && \
curl -OL "https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.xz" && \
tar -xvJ -f nasm-${NASM_VERSION}.tar.xz && \
cd nasm-${NASM_VERSION} && \
./configure && \
make -j$(nproc) && \
make install

# x264
RUN mkdir -p /dist && cd /dist && \
curl -OL "http://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264_VERSION}.tar.bz2" && \
tar -xvj -f x264-snapshot-${X264_VERSION}.tar.bz2 && \
cd x264-snapshot-${X264_VERSION} && \
./configure --prefix="${SRC}" --bindir="${SRC}/bin" --enable-shared && \
make -j$(nproc) && \
make install

# libmp3lame
RUN mkdir -p /dist && cd /dist && \
curl -OL "https://kent.dl.sourceforge.net/project/lame/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz" && \
tar -xvz -f lame-${LAME_VERSION}.tar.gz && \
cd lame-${LAME_VERSION} && \
./configure --prefix="${SRC}" --bindir="${SRC}/bin" --disable-static --enable-nasm && \
make -j$(nproc) && \
make install

# ffmpeg
RUN mkdir -p /dist && cd /dist && \
curl -OL "https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz" && \
tar -xvz -f ffmpeg-${FFMPEG_VERSION}.tar.gz && \
cd ffmpeg-${FFMPEG_VERSION} && \
./configure \
--prefix="${SRC}" \
--bindir="${SRC}/bin" && \
make -j"$(nproc)" && \
make install && \
make distclean && \
rm -rf "${DIR}" && \

# x264
DIR="$(mktemp -d)" && cd "${DIR}" && \
git clone --depth 1 "git://git.videolan.org/x264" && \
cd x264 && \
./configure \
--prefix="${SRC}" \
--bindir="${SRC}/bin" \
--enable-static \
--disable-cli && \
make -j"$(nproc)" && \
make install && \
make distclean && \
rm -rf "${DIR}" && \

# libmp3lame
DIR="$(mktemp -d)" && cd "${DIR}" && \
curl -LOks "https://github.com/rbrito/lame/archive/RELEASE__${LAME_VERSION}.tar.gz" && \
tar xzvf "RELEASE__${LAME_VERSION}.tar.gz" && \
cd "lame-RELEASE__${LAME_VERSION}" && \
./configure \
--prefix="${SRC}" \
--bindir="${SRC}/bin" \
--enable-nasm \
--disable-shared && \
make -j"$(nproc)" && \
make install && \
make distclean && \
rm -rf "${DIR}" && \

# ffmpeg
# patch: andrew-shulgin Ignore invalid sprop-parameter-sets missing PPS
DIR="$(mktemp -d)" && cd "${DIR}" && \
curl -LOks "https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz" && \
tar xzvf "ffmpeg-${FFMPEG_VERSION}.tar.gz" && \
cd "ffmpeg-${FFMPEG_VERSION}" && \
curl -Lks "https://github.com/FFmpeg/FFmpeg/commit/1c7e2cf9d33968375ee4025d2279c937e147dae2.patch" | patch -p1 && \
./configure \
--prefix="${SRC}" \
--bindir="${SRC}/bin" \
--extra-cflags="-I${SRC}/include" \
--extra-ldflags="-L${SRC}/lib" \
--extra-libs=-ldl \
--prefix="${SRC}" \
--enable-nonfree \
--enable-gpl \
--enable-version3 \
--enable-avresample \
--enable-libmp3lame \
--enable-libx264 \
--enable-openssl \
--enable-postproc \
--enable-small \
--enable-static \
--disable-debug \
--disable-doc \
--disable-ffserver && \
make -j"$(nproc)" && \
make install && \
make distclean && \
hash -r && \
cd tools && \
make qt-faststart && \
cp qt-faststart "${SRC}/bin" && \
rm -rf "${DIR}" && \
echo "${SRC}/lib" > "/etc/ld.so.conf.d/libc.conf" && \
ffmpeg -buildconf && \

# nginx-rtmp
DIR="$(mktemp -d)" && cd "${DIR}" && \
curl -LOks "https://github.com/nginx/nginx/archive/release-${NGINX_VERSION}.tar.gz" && \
tar xzvf "release-${NGINX_VERSION}.tar.gz" && \
curl -LOks "https://github.com/sergey-dryabzhinsky/nginx-rtmp-module/archive/v${NGINX_RTMP_VERSION}.tar.gz" && \
tar xzvf "v${NGINX_RTMP_VERSION}.tar.gz" && \
cd "nginx-release-${NGINX_VERSION}" && \
auto/configure \
--with-http_ssl_module \
--add-module="../nginx-rtmp-module-${NGINX_RTMP_VERSION}" && \
make -j"$(nproc)" && \
make install && \
rm -rf "${DIR}" && \

apt-get purge -y --auto-remove ${BUILDDEPS} && \
rm -rf /tmp/*
--disable-shared && \
make -j$(nproc) && \
make install

# nginx-rtmp
RUN mkdir -p /dist && cd /dist && \
curl -OL "https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" && \
tar -xvz -f "nginx-${NGINX_VERSION}.tar.gz" && \
curl -OL "https://github.com/arut/nginx-rtmp-module/archive/v${NGINXRTMP_VERSION}.tar.gz" && \
tar -xvz -f "v${NGINXRTMP_VERSION}.tar.gz" && \
cd nginx-${NGINX_VERSION} && \
./configure --prefix=/usr/local/nginx --with-http_ssl_module --add-module=/dist/nginx-rtmp-module-${NGINXRTMP_VERSION} && \
make -j$(nproc) && \
make install

# node.js
RUN mkdir -p /dist && cd /dist && \
curl -OL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz" && \
tar -xvJ -f "node-v${NODE_VERSION}-linux-x64.tar.xz" && \
cd node-v${NODE_VERSION}-linux-x64 && \
cp -R bin /usr/local && \
cp -R lib /usr/local

RUN rm -r /dist && \
apt-get remove -y \
pkg-config \
curl \
libpcre3-dev \
libtool \
libssl-dev \
zlib1g-dev \
build-essential && \
apt autoremove -y

FROM $IMAGE

COPY --from=builder /usr/local/bin /usr/local/bin
COPY --from=builder /usr/local/nginx /usr/local/nginx
COPY --from=builder /usr/local/lib /usr/local/lib

RUN apt-get update && \
apt-get install -y \
ca-certificates \
git \
procps \
libpcre3 \
libssl1.1 \
zlib1g \
v4l-utils \
libv4l-0 \
alsa-utils

COPY . /restreamer
WORKDIR /restreamer

RUN npm install -g bower grunt grunt-cli nodemon public-ip eslint && \
RUN cd /restreamer && \
npm install -g bower grunt grunt-cli nodemon eslint && \
npm install && \
grunt build && \
npm prune --production && \
npm cache clean && \
bower cache clean --allow-root
npm cache verify && \
bower cache clean --allow-root && \
npm uninstall -g bower grunt grunt-cli nodemon eslint && \
npm prune --production && \
apt-get remove -y \
git \
curl && \
apt autoremove -y

ENV RS_USERNAME admin
ENV RS_PASSWORD datarhei
Expand All @@ -131,3 +152,4 @@ EXPOSE 8080
VOLUME ["/restreamer/db"]

CMD ["./run.sh"]

Loading

0 comments on commit 0930b01

Please sign in to comment.