From 095f2c66e0a003d6d0051a4b1f6404d57907a901 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Sun, 24 Jan 2021 04:09:41 +0100 Subject: [PATCH] Update README --- README.md | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 102 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 31f32da..6fc7299 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,105 @@ - Copy example.db to app.db - Create yourself a user using `sqlite3` - Install [nginx-mod-rtmp](https://github.com/lhaus/nginx-mod-rtmp) -- Configure nginx-mod-rtmp (TODO: example config here) +- Configure nginx-mod-rtmp, example config below +- Start RTMPDash, example systemd unit below + +## Further setup +- Customize privacy policy to your environment if you plan on hosting it publicly + + +## nginx-mod-rtmp example config + +``` +rtmp { + log_format rtmp '[$time_local] $command -> $app with key "$name" - $bytes_received bytes received ($session_readable_time)'; + server { + listen 1935; + + access_log /var/log/nginx/rtmp_access.log rtmp; + + max_message 32M; + ping 1m; + ping_timeout 10s; + drop_idle_publisher 10s; + notify_method get; + + application ingress { + live on; + + allow play 127.0.0.1; + deny play all; + + notify_relay_redirect on; + + on_publish http://localhost:60001/api/authenticate; + } + + application src { + live on; + + allow publish 127.0.0.1; + deny publish all; + allow play 127.0.0.1; + deny play all; + + hls on; + hls_path /mnt/ssd_data/hls/src; + hls_fragment 1s; + hls_fragment_naming system; + hls_playlist_length 60s; + hls_allow_client_cache enabled; + } + } +} +``` + +## RTMPdash example systemd unit (development) +``` +[Unit] +Description=RTMPDash +Wants=network-online.target +After=network-online.target + +[Service] +User=rtmpdash +Group=rtmpdash +WorkingDirectory=/opt/rtmpdash +Environment=ASPNETCORE_URLS='http://*:60001' +Environment=ASPNETCORE_ENVIRONMENT=Production +ExecStart=/usr/bin/dotnet watch run --no-launch-profile +Type=simple +TimeoutStopSec=20 + +# Lets built in updater work well. +Restart=on-failure +KillMode=control-group + +[Install] +WantedBy=multi-user.target +``` + +## RTMPdash example systemd unit (production) +``` +[Unit] +Description=RTMPDash +Wants=network-online.target +After=network-online.target + +[Service] +User=rtmpdash +Group=rtmpdash +WorkingDirectory=/opt/rtmpdash +Environment=ASPNETCORE_URLS='http://*:60001' +Environment=ASPNETCORE_ENVIRONMENT=Production +ExecStart=/usr/bin/dotnet run --no-launch-profile +Type=simple +TimeoutStopSec=20 + +# Lets built in updater work well. +Restart=on-failure +KillMode=control-group + +[Install] +WantedBy=multi-user.target +```