sudo apt install nginx libnginx-mod-rtmp
* Sytemstatus (Dienste anzeigen) mit systemctl status
/etc/nginx/nginx.conf
systemctl restart nginx
Dienst neustarten/srv/www
, hier die Web-Seiten ablegen. <link/>
eingebunden (<head></head>
)<video></video>
den Stream einbindenworker_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; } } }
<!DOCTYPE html> <html> <head> <link href="https://vjs.zencdn.net/7.8.4/video-js.css" rel="stylesheet" /> <title>Teststream</title> <style> body{ background-color: black; } </style> </head> <body> <video id="my-video" class="video-js" controls preload="auto" width="1280" height="960" data-setup="{}"> <source src="test.m3u8" type="application/vnd.apple.mpegurl" /> <p class="vjs-no-js"> To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="https://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a> </p> </video> <script src="https://vjs.zencdn.net/7.8.4/video.js"></script> </body> </html>