Skip to content
This repository was archived by the owner on Nov 11, 2024. It is now read-only.

Commit 3aa675a

Browse files
committed
Replace nginx rtmp module with nginx http flv module
Signed-off-by: Zhizhen Tang <[email protected]>
1 parent 6bc8288 commit 3aa675a

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

cdn-server/Dockerfile

+13-12
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,19 @@ ARG AUTOMAKE_VER=1.14
1919
ARG AUTOMAKE_REPO=https://ftp.gnu.org/pub/gnu/automake/automake-${AUTOMAKE_VER}.tar.xz
2020
RUN apt-get install -y -q automake
2121

22-
# Build nginx-rtmp
23-
ARG NGINX_RTMP_VER=v1.2.1
24-
ARG NGINX_RTMP_REPO=https://github.com/arut/nginx-rtmp-module/archive/${NGINX_RTMP_VER}.tar.gz
25-
ARG NGINX_RTMP_PATCH_HLS=https://raw.githubusercontent.com/VCDP/CDN/master/0001-add-hevc-support-for-rtmp-and-hls.patch
26-
ARG NGINX_RTMP_PATCH_DASH=https://raw.githubusercontent.com/VCDP/CDN/master/0002-add-HEVC-support-for-dash.patch
27-
ARG NGINX_RTMP_PATCH_DASH_ABR=https://raw.githubusercontent.com/VCDP/CDN/master/v1-0001-Add-some-dash-features.patch
22+
# Build nginx-http-flv
23+
ARG NGINX_HTTP_FLV_VER=04dc8369b260c8c851f12fc30ea2f9df03f73c4e
24+
ARG NGINX_HTTP_FLV_REPO=https://github.com/winshining/nginx-http-flv-module.git
25+
ARG NGINX_HTTP_FLV_PATCH_HLS=https://raw.githubusercontent.com/VCDP/CDN/master/0001-Add-hevc-support-for-rtmp-and-hls-on-Nginx-Http-Flv.patch
26+
ARG NGINX_HTTP_FLV_PATCH_DASH=https://raw.githubusercontent.com/VCDP/CDN/master/0002-add-HEVC-support-for-dash.patch
27+
ARG NGINX_HTTP_FLV_PATCH_DASH_ABR=https://raw.githubusercontent.com/VCDP/CDN/master/0001-Add-dash-ABR-mode-support-on-Nginx-Http-Flv.patch
2828

29-
RUN wget -O - ${NGINX_RTMP_REPO} | tar xz && mv nginx-rtmp-module-${NGINX_RTMP_VER#v} nginx-rtmp-module && \
30-
cd nginx-rtmp-module && \
31-
wget -O - ${NGINX_RTMP_PATCH_HLS} | patch -p1 && \
32-
wget -O - ${NGINX_RTMP_PATCH_DASH} | patch -p1 && \
33-
wget -O - ${NGINX_RTMP_PATCH_DASH_ABR} | patch -p1
29+
RUN git clone ${NGINX_HTTP_FLV_REPO} && \
30+
cd nginx-http-flv-module && \
31+
git checkout ${NGINX_HTTP_FLV_VER} && \
32+
wget -O - ${NGINX_HTTP_FLV_PATCH_HLS} | patch -p1 && \
33+
wget -O - ${NGINX_HTTP_FLV_PATCH_DASH} | patch -p1 && \
34+
wget -O - ${NGINX_HTTP_FLV_PATCH_DASH_ABR} | patch -p1
3435

3536

3637
# Build nginx & nginx-rtmp
@@ -41,7 +42,7 @@ RUN apt-get update && apt-get install -y -q --no-install-recommends libssl-dev l
4142

4243
RUN wget -O - ${NGINX_REPO} | tar xz && \
4344
cd nginx-${NGINX_VER} && \
44-
./configure --prefix=/var/www --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/x86_64-linux-gnu/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/www/log/error.log --pid-path=/var/www/nginx.pid --lock-path=/var/www/nginx.lock --http-log-path=/var/www/log/access.log --http-client-body-temp-path=/var/www/tmp/client_body --http-proxy-temp-path=/var/www/tmp/proxy --http-fastcgi-temp-path=/var/www/tmp/fastcgi --http-uwsgi-temp-path=/var/www/tmp/uwsgi --http-scgi-temp-path=/var/www/tmp/scgi --user=www-data --group=www-data --with-select_module --with-poll_module --with-threads --with-file-aio --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-stream --with-stream_ssl_module --with-stream_realip_module --with-stream_ssl_preread_module --with-pcre --add-module=../nginx-rtmp-module && \
45+
./configure --prefix=/var/www --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/x86_64-linux-gnu/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/www/log/error.log --pid-path=/var/www/nginx.pid --lock-path=/var/www/nginx.lock --http-log-path=/var/www/log/access.log --http-client-body-temp-path=/var/www/tmp/client_body --http-proxy-temp-path=/var/www/tmp/proxy --http-fastcgi-temp-path=/var/www/tmp/fastcgi --http-uwsgi-temp-path=/var/www/tmp/uwsgi --http-scgi-temp-path=/var/www/tmp/scgi --user=www-data --group=www-data --with-select_module --with-poll_module --with-threads --with-file-aio --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-stream --with-stream_ssl_module --with-stream_realip_module --with-stream_ssl_preread_module --with-pcre --add-module=../nginx-http-flv-module && \
4546
make -j8 && \
4647
make install DESTDIR=/home/build
4748

cdn-server/nginx.conf

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ rtmp {
2323
hls_nested on;
2424
hls_fragment 3;
2525
hls_playlist_length 60;
26+
hls_variant _low BANDWIDTH=2048000 RESOLUTION=854x480;
27+
hls_variant _mid BANDWIDTH=4096000 RESOLUTION=1280x720;
28+
hls_variant _hi BANDWIDTH=8192000 RESOLUTION=1920x1080;
2629
}
2730

2831
application dash {

0 commit comments

Comments
 (0)