Browse Source

added ispooge daily rtmp conf

Harlan Iverson 7 năm trước cách đây
mục cha
commit
c0e5db6619

+ 3 - 0
rtmp-proxy-docker/cleanup-segments.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+sudo rm /tmp/hls/ispooge.com/ispoogedaily/*.ts

+ 3 - 0
rtmp-proxy-docker/fix-perms.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+sudo chmod -R a+rx /tmp/hls/ispooge.com/ispoogedaily

+ 146 - 0
rtmp-proxy-docker/nginx-ispooge.conf

@@ -0,0 +1,146 @@
+worker_processes auto;
+rtmp_auto_push on;
+events {}
+rtmp {
+    server {
+        listen 1935;
+        #listen [::]:1935 ipv6only=on;
+
+        chunk_size 4096;
+
+
+        application studiocam {
+
+            live on;
+            record off;
+
+            allow publish all;
+            allow play all;
+
+#            exec_static /usr/bin/avconv -f v4l2 -i /dev/video0 -c:v libx264 -an -f flv rtmp://127.0.0.1:1935/studiocam/live;
+
+        }
+
+
+        application  hdmi {
+            live on;
+            record off;
+
+            allow publish 192.168.2.0/24;
+            deny publish all;
+
+            # record hdmi
+            # push 192.168.1.9:1935/ispoogemedia/hdmi;
+        }
+
+
+
+        application  cam {
+            live on;
+            record off;
+
+            allow publish 192.168.1.0/24;
+            deny publish all;
+        }
+
+
+
+        # monitor rtmp
+        application record {
+            live on;
+
+            allow publish 127.0.0.0/24;
+            deny publish all;
+            deny play all;
+
+            record all;
+            record_path /tmp/rec;
+            record_suffix _%Y-%m-%d_%H-%M-%S.flv;
+            record_lock on;
+        }
+
+
+        application hls {
+            live on;
+
+            allow publish 127.0.0.0/8;
+            deny publish all;
+            allow play all;
+
+#            pull rtmp://127.0.0.1:1935/ispoogedaily/ispoogedaily name=ispooge_com_hls live=1 static=1;
+
+            hls on;
+            hls_path /tmp/hls/ispooge.com;
+            hls_fragment 500ms;
+            hls_playlist_length 3s;
+#            hls_fragment_naming_granularity 1s;
+
+            hls_continuous off;
+            hls_nested on;
+            hls_cleanup off;
+            hls_fragment_naming system;
+            hls_fragment_slicing aligned;
+            hls_type live;
+        }
+
+        # push to monitoring, push to recording
+
+
+        application  ispoogedaily {
+            live on;
+            record off;
+
+            allow publish 127.0.0.0/8;
+            deny publish all;
+
+            allow play all;
+        }
+
+        application ispoogedaily_local {
+            live on;
+
+            allow publish 127.0.0.0/8;
+            allow publish 192.168.1.2;
+            allow publish 192.168.1.3;
+            deny publish all;
+            deny play all;
+
+            push rtmp://127.0.0.1:1935/ispoogedaily/ispoogedaily live=1;
+            push rtmp://127.0.0.1:1935/record/ispoogedaily live=1;
+
+
+            push rtmp://127.0.0.1:1935/hls/ispoogedaily name=ispoogedaily live=1;
+        }
+
+
+        # push to upstream services, including ispooge media
+        application  ispoogedaily_live {
+            live on;
+
+            allow publish 127.0.0.0/8;
+            allow publish 192.168.1.2;
+            allow publish 192.168.1.3;
+
+            deny publish all;
+#            deny play all;
+
+            push rtmp://127.0.0.1:1935/ispoogedaily_local/ispoogedaily_live;
+#            push rtmp://live-api.facebook.com:80/rtmp/_?ds=_;
+
+            # Periscope
+            #push rtmp://ca.pscp.tv:80/x/_;
+
+
+            # YT LIVE
+            push rtmp://a.rtmp.youtube.com/live2/_ live=1;
+
+            # YT EVENT
+            # push rtmp://a.rtmp.youtube.com/live2/_;
+        }
+
+
+
+
+
+    }
+}

+ 22 - 0
rtmp-proxy-docker/start.sh

@@ -0,0 +1,22 @@
+#!/bin/bash
+
+
+if [ ! -d $HOME/rec ]; then
+  mkdir $HOME/rec
+fi
+
+if [ ! -d /tmp/hls/ispooge.com ]; then
+  mkdir -p /tmp/hls/ispooge.com
+fi
+
+chmod -R a+rx /tmp/hls
+chmod a+ws /tmp/hls/ispooge.com
+
+
+docker run \
+ --name rtmp-proxy \
+ -d --restart always \
+ -p 1935:1935 \
+ --mount type=bind,source=/tmp/hls/ispooge.com,target=/tmp/hls/ispooge.com \
+ --mount type=bind,source=$HOME/rec,target=/tmp/rec \
+nginx-rtmp 

+ 4 - 0
rtmp-proxy-docker/stop.sh

@@ -0,0 +1,4 @@
+#!/bin/bash
+
+
+docker rm -f rtmp-proxy