Hello,

This diff adds the rtmp nginx module.

It allows nginx to stream video through rtmp / hls / mjpeg protocols.
It can also reencode on-the-fly with ffmpeg, or relay to another server.

I use it for streaming video games playing, using ffmpeg on my laptop
to send data to remote nginx, then people can use mpv
rtmp://nginx-server/ to view videos. It works very well and is super
easy to use.

It's a BSD 2-clause licence, I think it fits the current ports licence.

Index: Makefile
===================================================================
RCS file: /data/cvs/ports/www/nginx/Makefile,v
retrieving revision 1.136
diff -u -p -r1.136 Makefile
--- Makefile    19 Aug 2019 13:43:21 -0000      1.136
+++ Makefile    25 Aug 2019 10:15:11 -0000
@@ -14,12 +14,14 @@ COMMENT-lua=                nginx lua scripting module
 COMMENT-headers_more=  nginx module for setting/adding/clearing headers
 COMMENT-perl=          nginx perl scripting module
 COMMENT-passenger=     nginx passenger (ruby/python/nodejs) integration module
+COMMENT-rtmp=          nginx module for RTMP streaming
 
 VERSION=       1.16.1
 DISTNAME=      nginx-${VERSION}
 CATEGORIES=    www
 
 REVISION-main= 0
+VERSION-rtmp=1.2.1
 
 PKGNAME-main=          ${DISTNAME}
 PKGNAME-image_filter=  nginx-image_filter-${VERSION}
@@ -33,6 +35,8 @@ PKGNAME-lua=          nginx-lua-${VERSION}
 PKGNAME-headers_more=  nginx-headers-more-${VERSION}
 PKGNAME-perl=          nginx-perl-${VERSION}
 PKGNAME-passenger=     nginx-passenger-${VERSION}
+PKGNAME-rtmp=          nginx-rtmp-${VERSION}
+
 
 MASTER_SITES=  https://nginx.org/download/
 MASTER_SITES0= https://github.com/simpl/ngx_devel_kit/archive/
@@ -41,13 +45,15 @@ MASTER_SITES2=      https://github.com/openre
 MASTER_SITES3= 
https://raw.githubusercontent.com/rnagy/nginx_chroot_patch/master/
 MASTER_SITES4= https://github.com/openresty/headers-more-nginx-module/archive/
 MASTER_SITES5= https://github.com/kvspb/nginx-auth-ldap/archive/
+MASTER_SITES6= https://github.com/arut/nginx-rtmp-module/archive/
 
 DISTFILES=     ${DISTNAME}${EXTRACT_SUFX} \
                ngx_devel_kit-{}v0.3.0.tar.gz:0 \
                naxsi-{}0.55.3.tar.gz:1 \
                lua-nginx-module-{}v0.10.11.tar.gz:2 \
                headers-more-nginx-module-{}v0.33.tar.gz:4 \
-               
nginx-auth-ldap-0.20170725{42d195d7a7575ebab1c369ad3fc5d78dc2c2669c}.tar.gz:5
+               
nginx-auth-ldap-0.20170725{42d195d7a7575ebab1c369ad3fc5d78dc2c2669c}.tar.gz:5 \
+               nginx-rtmp-module-{v${VERSION-rtmp}}.tar.gz:6
 
 HOMEPAGE=      http://nginx.org/
 
@@ -57,10 +63,10 @@ MAINTAINER= Robert Nagy <robert@openbsd.
 PERMIT_PACKAGE=        Yes
 
 MULTI_PACKAGES =       -main -image_filter -geoip -xslt -mailproxy -stream \
-                       -naxsi -perl -passenger -headers_more -ldap_auth -lua
+                       -naxsi -perl -passenger -headers_more -ldap_auth -lua 
-rtmp
 
 FLAVOR ?=
-PSEUDO_FLAVORS =       no_lua no_passenger
+PSEUDO_FLAVORS =       no_lua no_passenger no_rtmp
 
 COMPILER =             base-clang ports-gcc base-gcc
 
@@ -86,6 +92,8 @@ LIB_DEPENDS-image_filter=graphics/gd
 LIB_DEPENDS-geoip=     net/GeoIP
 LIB_DEPENDS-ldap_auth= databases/openldap
 LIB_DEPENDS-lua=       ${MODLUA_LIB_DEPENDS}
+LIB_DEPENDS-rtmp=      textproc/libxml \
+                       textproc/libxslt
 
 MODLUA_RUNDEP=         No
 RUN_DEPENDS=           www/nginx,-main=${VERSION}
@@ -108,6 +116,7 @@ PREFIX-ldap_auth=   ${NGINX_MODULES_DIR}
 PREFIX-lua=            ${NGINX_MODULES_DIR}
 PREFIX-headers_more=   ${NGINX_MODULES_DIR}
 PREFIX-passenger=      ${NGINX_MODULES_DIR}
+PREFIX-rtmp=   ${NGINX_MODULES_DIR}
 
 CFLAGS+=       -Wall -Wpointer-arith \
                -I "${LOCALBASE}/include/libxml2" \
@@ -133,6 +142,10 @@ MODRUBY_BUILDDEP=  No
 MODRUBY_RUNDEP=                No
 BUILD_DEPENDS+=                
${MODRUBY_PKG_PREFIX}-passenger-*:www/ruby-passenger
 CONFIGURE_ARGS+=       
--add-dynamic-module=${LOCALBASE}/lib/phusion-passenger${GEM_BIN_SUFFIX}/src/nginx_module
+.endif
+
+.if ${BUILD_PACKAGES:M-rtmp}
+CONFIGURE_ARGS+=       
--add-dynamic-module=${WRKDIR}/nginx-rtmp-module-${VERSION-rtmp}/
 .endif
 
 CONFIGURE_ARGS+=       --prefix=${NGINX_DIR} \
Index: distinfo
===================================================================
RCS file: /data/cvs/ports/www/nginx/distinfo,v
retrieving revision 1.70
diff -u -p -r1.70 distinfo
--- distinfo    18 Aug 2019 14:26:32 -0000      1.70
+++ distinfo    25 Aug 2019 10:04:23 -0000
@@ -4,6 +4,7 @@ SHA256 (naxsi-0.55.3.tar.gz) = CzyV0lB3L
 SHA256 (nginx-1.16.1-chroot.patch) = 
ohNkspocgL7QnBX7q8Kgv2lgrN0ndgLKd0v5nSCLQRU=
 SHA256 (nginx-1.16.1.tar.gz) = 8RwqbdHTUVc28DJIV5V9st6YvoYkYbWlQqOsYYjb4ys=
 SHA256 (nginx-auth-ldap-0.20170725.tar.gz) = 
gNbM6amHfVHewvhaEc580l7b0tYFwovChofsxWlSKe4=
+SHA256 (nginx-rtmp-module-.tar.gz) = 
h6pZdACwtaBSdO4tI9jLgiThJoYiegq+MdeDs6ZF6jc=
 SHA256 (ngx_devel_kit-v0.3.0.tar.gz) = 
iOBamainQZBm9a51lm+x78QJutRSLRSYbaB0VUrmFhk=
 SIZE (headers-more-nginx-module-v0.33.tar.gz) = 28130
 SIZE (lua-nginx-module-v0.10.11.tar.gz) = 616653
@@ -11,4 +12,5 @@ SIZE (naxsi-0.55.3.tar.gz) = 187416
 SIZE (nginx-1.16.1-chroot.patch) = 8220
 SIZE (nginx-1.16.1.tar.gz) = 1032630
 SIZE (nginx-auth-ldap-0.20170725.tar.gz) = 18457
+SIZE (nginx-rtmp-module-.tar.gz) = 519919
 SIZE (ngx_devel_kit-v0.3.0.tar.gz) = 66455
Index: pkg/DESCR-rtmp
===================================================================
RCS file: pkg/DESCR-rtmp
diff -N pkg/DESCR-rtmp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ pkg/DESCR-rtmp      25 Aug 2019 10:06:39 -0000
@@ -0,0 +1,4 @@
+nginx-rtmp is an nginx module to allow RTMP/HLS/MPEG-DASH streaming.
+It has features like live streaming, relaying, saving and transcoding
+on the fly using ffmpeg.
+It supports http callbacks and controls.
Index: pkg/PLIST-rtmp
===================================================================
RCS file: pkg/PLIST-rtmp
diff -N pkg/PLIST-rtmp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ pkg/PLIST-rtmp      30 Jul 2019 16:21:23 -0000
@@ -0,0 +1,2 @@
+@comment $OpenBSD: PLIST-rtmp,v$
+ngx_rtmp_module.so

Reply via email to