Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| nginx-rtmp-module [2013/11/05 10:49] – [compile] meise | nginx-rtmp-module [2026/07/26 21:08] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | # nginx-rtmp-module | ||
| + | |||
| + | ## debian pakete | ||
| + | |||
| + | \< | ||
| + | libpcre3-dev libbz2-dev libssl-dev tar unzip \</ | ||
| + | |||
| + | ## compile | ||
| + | |||
| + | \< | ||
| + | --with-http_stub_status_module \</ | ||
| + | |||
| + | ## rtmp | ||
| + | |||
| + | / | ||
| + | |||
| + | 1. multiple worker worker_processes 2; | ||
| + | 2. important for multi worker processes!!1! rtmp_auto_push on; | ||
| + | |||
| + | error_log / | ||
| + | |||
| + | events { worker_connections 2048; } | ||
| + | |||
| + | http { server { listen \[::\]:80 default ipv6only=off; | ||
| + | |||
| + | root / | ||
| + | |||
| + | server_name localhost; | ||
| + | |||
| + | 1. html page stuff location / { try_files \$uri \$uri/ / | ||
| + | |||
| + | location /releases { alias / | ||
| + | |||
| + | location / | ||
| + | "Auf zum Atem!!1!"; | ||
| + | autoindex on; } | ||
| + | |||
| + | 1. hls location /hls { types { application/ | ||
| + | video/mp2t ts; } | ||
| + | |||
| + | alias /tmp/hls; autoindex on; } | ||
| + | |||
| + | 1. stats location /stats/rtmp { rtmp_stat all; allow 127.0.0.1; allow | ||
| + | 195.54.164.160/ | ||
| + | meise deny all; } | ||
| + | |||
| + | location / | ||
| + | allow 195.54.164.160/ | ||
| + | meise deny all; } } | ||
| + | |||
| + | } | ||
| + | |||
| + | rtmp { server { listen \[::\]:1935 ipv6only=off; | ||
| + | |||
| + | ping 30s; | ||
| + | |||
| + | 1. Disable audio until first video frame is sent. wait_video on; | ||
| + | 2. Send NetStream.Publish.Start and NetStream.Publish.Stop to | ||
| + | subscribers. publish_notify on; | ||
| + | |||
| + | <!-- --> | ||
| + | |||
| + | 1. Synchronize audio and video streams. If subscriber bandwidth is not | ||
| + | 2. enough to receive data at ublisher rate some frames are dropped by | ||
| + | 3. server. This leads to synchronization problem. When timestamp | ||
| + | 4. difference exceeds the value specified as sync argument an absolute | ||
| + | 5. frame is sent fixing that. Default is 300ms. sync 10ms; | ||
| + | |||
| + | application stream { | ||
| + | |||
| + | 1. enable live streaming live on; meta copy; | ||
| + | |||
| + | hls on; hls_path /tmp/hls; hls_fragment 5; | ||
| + | |||
| + | 1. publish only from localhost allow publish 127.0.0.1; deny publish | ||
| + | all; | ||
| + | |||
| + | allow play all; } } } \</ | ||
| + | |||
| + | ffmpeg push: \< | ||
| + | yuv420p -profile:v baseline -preset fast -tune zerolatency -c:v libx264 | ||
| + | -strict -2 -c:a aac -f flv < | ||
| + | \</ | ||
| + | |||
| + | ## hls | ||
| + | |||
| + | / | ||
| + | |||
| + | → siehe Abschnitt hls und http in der rtmp Konfiguration. | ||
| + | |||
| + | ffmpeg push: \< | ||
| + | yuv420p -profile:v baseline -preset fast -tune zerolatency -c:v libx264 | ||
| + | -strict -2 -c:a aac -f flv < | ||
| + | \</ | ||
| + | |||
| + | - Das Verhaeltnis aus Segmentlaenge, | ||
| + | Kaskadentiefe war falsch. Die cache-duration muss \< segment-laenge / | ||
| + | 2 sein, bei 2 Cache-Stufen (wie bei uns) / 8. Fixed durch Setzen der | ||
| + | Segmentlaenge auf 10s. (Unsere m3u8 cache-duration war und ist 1s) | ||