mostly improvements
authorIan Kelling <ian@iankelling.org>
Wed, 27 Mar 2024 19:36:29 +0000 (15:36 -0400)
committerIan Kelling <ian@iankelling.org>
Wed, 27 Mar 2024 19:36:29 +0000 (15:36 -0400)
distro-end
filesystem/etc/nginx/conf.d/rtmp.conf [new file with mode: 0644]
script-files
system-status
ziva-screen

index acc1507d18283fc0ae72a6b7155a04edb8a4142d..16fc7a5b0afbcfe6e46291c24ce4edbf3a1e744d 100755 (executable)
@@ -2009,6 +2009,18 @@ esac
 
 ### end bitcoin
 
+### begin live streaming ###
+
+# comparing nginx rtmp to icecast
+# `mpv --cache=no` had about 2.5 sec latency vs 4 seconds.
+# Then I discovered this command which had about .5 sec latency:
+#ffplay -f live_flv -fast -x 1280 -y 720 -fflags nobuffer -flags low_delay -strict experimental -vf "setpts=N/60/TB" -af "asetpts=N/60/TB" -noframedrop -i rtmp://url_here
+#
+pi nginx libnginx-mod-rtmp
+
+
+### end live streaming ###
+
 ### begin gh ####
 
 # from https://raw.githubusercontent.com/cli/cli/trunk/docs/install_linux.md
diff --git a/filesystem/etc/nginx/conf.d/rtmp.conf b/filesystem/etc/nginx/conf.d/rtmp.conf
new file mode 100644 (file)
index 0000000..4a47eda
--- /dev/null
@@ -0,0 +1,13 @@
+# based on https://opensource.com/article/19/1/basic-live-video-streaming-server#comments
+# and https://github.com/arut/nginx-rtmp-module/wiki/Directives
+rtmp {
+    allow publish 127.0.0.1;
+    deny publish all;
+    server {
+        listen 1935;
+        application live {
+            live on;
+            record off;
+        }
+    }
+}
index b4f8b6138cb4688bdeb00f2a5ab004073657a584..1a63f564737f03fba9a4b8c11c1678e455a1555e 100644 (file)
@@ -23,6 +23,7 @@ my_bin_files=(
   prof-backup
   prof-tail
   prof-notify
+  /a/bin/newns/newns
 )
 
 for f in /b/log-quiet/*; do
index 0e63964a78c519d1e5c1f0462fed7848ecc9d290..dd327bb0836979310df0476389df5d4971a106dc 100755 (executable)
@@ -389,6 +389,20 @@ write-status() {
     # leave it up to epanic-clean to send email notification
   fi
 
+  mprom=/var/lib/prometheus/node-exporter/mailtest-check.prom
+  if grep -qE 'mailtest_check_(unexpected|missing).*[^ ][^0]$' $mprom; then
+    chars+=("MTEST_SPAM")
+  fi
+  mtest_found=false
+  for t in $(grep -E ^mailtest_check_last_usec $mprom | awk '{print $NF}'); do
+    if (( t + 60 * 20 < EPOCHSECONDS )); then
+      mtest_found=true
+    fi
+  done
+  if $mtest_found; then
+    chars+=("MTEST_AGE")
+  fi
+
   if [[ ! -e $status_file || -w $status_file ]]; then
     if [[ -e /a/bin/bash_unpublished/source-state ]]; then
       cat /a/bin/bash_unpublished/source-state >$status_file
index c512673009d4c56a40f24b3967e7a7ee4437c187..646ae91c73bda9af582f05898f3d1a1d8ede8020 100755 (executable)
@@ -15,7 +15,7 @@ esac
 
 f=/run/user/1000/ziva-tmp.jpg
 
-mkdir -p $dest_dir
+install -g 1000 -o 1000 -m 700 $dest_dir
 cd $dest_dir
 shopt -s nullglob
 jpgs=( 20*jpg )