# Dokumentation matelight Stream {{tag> matelight rc3 web server}} * Webserver: NGINX https://www.nginx.com/ mit RTMP (Real-time-message protocol) Installation mit ```sudo apt install nginx libnginx-mod-rtmp``` * Sytemstatus (Dienste anzeigen) mit ```systemctl status``` * Konfguration in ```/etc/nginx/nginx.conf``` * dann mit ```systemctl restart nginx``` Dienst neustarten * Standardport für RTMP-Streams 1935 * mime-type (https://de.wikipedia.org/wiki/Internet_Media_Type) für Streams application/octet-stream * Pfad für den Server konfigurieren, z.B. ```/srv/www```, hier die Web-Seiten ablegen. * Stylesheet für Stream (video-js.css) wird im Header der HTML-Seite mit `````` eingebunden (``````) * im Body mit `````` den Stream einbinden * JavaSkript Video.js zeigt den Stream an. https://hlsbook.net/hls-nginx-rtmp-module/ ## NGINX-Config (/etc/nginx/nginx.conf) ```nginx worker_processes auto; error_log /var/log/nginx/error.log warn; pid /run/nginx.pid; load_module modules/ngx_rtmp_module.so; events { worker_connections 1024; } rtmp { access_log /var/log/nginx/rtmp.log; server { listen 1935; application live { live on; hls on; hls_path /srv/www; hls_fragment 6s; hls_keys on; hls_key_path /srv/www/keys; hls_key_url /keys/; hls_fragments_per_key 10; } } } http { include mime.types; default_type application/octet-stream; access_log /var/log/nginx/access.log; map $sent_http_content_type $expires { default 1d; application/vnd.apple.mpegurl epoch; } server { listen 80; location / { root /srv/www; expires $expires; } } } ``` ## HTML-Seite (/srv/www/index.html) ```html Teststream ```