Selaa lähdekoodia

added transcoding scripts

Harlan Iverson 7 vuotta sitten
vanhempi
commit
fd4ecec481

+ 4 - 0
README.md

@@ -88,6 +88,10 @@ to `http://$HOST:33936/live-360p.html`.
 
 Publish an RTMP stream such as OBS or a webcam to `rtmp://$HOST:33935/ispoogedaily_local/ispoogedaily_360`.
 
+For the best results, you should use the transcoding options available... to do this
+you publish instead to `rtmp://$HOST:33935/ispoogedaily_source/ispoogedaily_360` and then run the
+transcoding script `scripts/transcode-stream-360p.sh`. This script is optimized for
+RasPi3's H264 accelerated hardware.
 
 ### Syndicating
 

+ 1 - 95
nginx.conf

@@ -63,22 +63,13 @@ rtmp {
 
         application participant {
             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;
@@ -89,13 +80,6 @@ rtmp {
         application hls {
             live on;
 
-            allow publish 127.0.0.0/8;
-            allow publish 192.168.1.0/24;
-            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_base_url http://192.168.1.8:33080/hls/;
@@ -115,86 +99,19 @@ rtmp {
             hls_variant _240 BANDWIDTH=1248576 RESOLUTION=416x240;
         }
 
-        # 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 all;
-            allow play all;
-
-            push rtmp://127.0.0.1:1935 app=ispoogedaily live=1;
-
-
-            #push rtmp://127.0.0.1:1935/record live=1;
-
-
-
             push rtmp://127.0.0.1 app=hls live=1;
         }
 
 
-        application ispoogedaily_source_720 {
-            live on;
-
-            allow publish all;
-            allow play 127.0.0.0/8;
-            allow play all;
-
-            #push rtmp://127.0.0.1:1935 app=ispoogedaily live=1;
-
-
-            #push rtmp://127.0.0.1:1935/record live=1;
-
-            #exec /ffmpeg -hide_banner -y -i rtmp://localhost/$app -c:a copy -c:v h264 -profile:v main -sc_threshold 0 -g 50 -keyint_min 50 -vf scale=w=1280:h=720:force_original_aspect_ratio=decrease -b:v 6000k -maxrate 6420k -bufsize 9000k -f flv rtmp://localhost/ispoogedaily_local/ispoogedaily_720;
-        }
-
-
-        application ispoogedaily_source_360 {
-            live on;
-
-            allow publish all;
-            allow play 127.0.0.0/8;
-            allow play all;
-            deny play all;
-
-            #push rtmp://127.0.0.1:1935 app=ispoogedaily live=1;
-
-
-            #push rtmp://127.0.0.1:1935/record live=1;
-
-            #exec /ffmpeg -hide_banner -y -i rtmp://localhost/$app -c:a copy -c:v h264 -profile:v main -sc_threshold 0 -g 50 -keyint_min 50 -vf scale=w=640:h=360:force_original_aspect_ratio=decrease -b:v 2800k -maxrate 3200k -bufsize 9000k -f flv rtmp://localhost/ispoogedaily_local/ispoogedaily_360;
-        }
-
-
-        application ispoogedaily_source_240 {
+        application ispoogedaily_source {
             live on;
-
-            allow publish all;
-            allow play 127.0.0.0/8;
-            allow play all;
-
-            #push rtmp://127.0.0.1:1935 app=ispoogedaily live=1;
-
-
-            #push rtmp://127.0.0.1:1935/record live=1;
-
-            #exec /ffmpeg -hide_banner -y -i rtmp://localhost/$app -c:a copy -c:v h264 -profile:v main -sc_threshold 0 -g 50 -keyint_min 50 -vf scale=w=1280:h=720:force_original_aspect_ratio=decrease -b:v 6000k -maxrate 6420k -bufsize 9000k -f flv rtmp://localhost/ispoogedaily_local/ispoogedaily_240;
         }
 
 
-        # push to upstream services, including ispooge media
         application  ispoogedaily_live {
             live on;
             #play_restart on;
@@ -205,22 +122,11 @@ rtmp {
             # interleave on;
             #meta copy;
 
-            allow publish all;
-
-            deny publish all;
-#            deny play all;
-
-
             # YT LIVE
             push rtmp://a.rtmp.youtube.com app=live2 playpath=YT_KEY live=1;
 
             # Twitch
             push rtmp://live-sjc.twitch.tv app=app playpath=TWITCH_KEY live=1;
-
         }
-
-
-
-
     }
 }

+ 2 - 2
scripts/env.sh

@@ -23,5 +23,5 @@ IMAGE_STATIC=docker-registry.local:5000/ispooge.com/ispooge-static:25
 IMAGE_STATIC_LOCAL=ispooge-static
 
 NAME_STREAMING=ispooge.com-streaming
-IMAGE_STREAMING=docker-registry.local:5000/ispooge.com/ispooge-streaming:1
-IMAGE_STREAMING_LOCAL=ispooge-streaming
+IMAGE_STREAMING=docker-registry.local:5000/ispooge.com/ispooge-streaming:2
+IMAGE_STREAMING_LOCAL=ispooge-streaming

+ 8 - 0
scripts/transcode-stream-240p.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+./ffmpeg -hide_banner -y -codec:v h264_mmal \
+  -i rtmp://localhost:33935/ispoogedaily_source/ispoogedaily_240 \
+  -c:a copy -c:v h264 -profile:v main -sc_threshold 0 -g 60 -keyint_min 50 \
+  -vf scale=w=426:h=240:force_original_aspect_ratio=decrease \
+  -b:v 800k -maxrate 1000k -bufsize 10000k \
+  -f flv rtmp://localhost:33935/ispoogedaily_local/ispoogedaily_240

+ 8 - 0
scripts/transcode-stream-360p.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+./ffmpeg -hide_banner -y -codec:v h264_mmal \
+  -i rtmp://localhost:33935/ispoogedaily_source/ispoogedaily_360 \
+  -c:a copy -c:v h264 -profile:v main -sc_threshold 0 -g 60 -keyint_min 50 \
+  -vf scale=w=640:h=360:force_original_aspect_ratio=decrease \
+  -b:v 3000k -maxrate 3210k -bufsize 32100k \
+  -f flv rtmp://localhost:33935/ispoogedaily_local/ispoogedaily_360

+ 8 - 0
scripts/transcode-stream-720p.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+./ffmpeg -hide_banner -y -codec:v h264_mmal \
+  -i rtmp://localhost:33935/ispoogedaily_source/ispoogedaily_720 \
+  -c:a copy -c:v h264 -profile:v main -sc_threshold 0 -g 60 -keyint_min 50 \
+  -vf scale=w=1280:h=720:force_original_aspect_ratio=decrease \
+  -b:v 6000k -maxrate 6420k -bufsize 64200k \
+  -f flv rtmp://localhost:33935/ispoogedaily_local/ispoogedaily_720