Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #user nobody;
- worker_processes 1;
- events {
- worker_connections 1024;
- }
- rtmp {
- server {
- listen 1935;
- chunk_size 4096;
- application hls {
- # Application for writing HLS chunks to /var/www/hls/
- live on;
- hls on;
- hls_path /var/www/hls;
- hls_nested on;
- hls_playlist_length 10m; # 10 minutes takes about 300 MB.
- hls_type live;
- pull rtmp://IPDUSERVEUR/hls/live_low name=live_low static;
- pull rtmp://IPDUSERVEUR/hls/live_mid name=live_mid static;
- pull rtmp://IPDUSERVEUR/hls/live_hi name=live_hi static;
- hls_variant _low BANDWIDTH=512000;
- hls_variant _mid BANDWIDTH=1024000;
- hls_variant _hi BANDWIDTH=2048000;
- # maximum allowed connections
- # warning: the true limit shall be done at the http level,
- # this is for RTMP clients only
- # max_connections 512;
- # allow local publish only
- allow publish 127.0.0.1;
- deny publish all;
- # allow all RTMP clients
- allow play all;
- #deny play all;
- }
- }
- }
- # HTTP can be used for accessing RTMP stats
- http {
- include mime.types;
- default_type application/octet-stream;
- sendfile on;
- keepalive_timeout 65;
- #gzip on;
- server {
- listen 80;
- server_name localhost;
- # This URL provides RTMP statistics in XML
- location /stat {
- rtmp_stat all;
- # Use this stylesheet to view XML as web page
- # in browser
- rtmp_stat_stylesheet stat.xsl;
- }
- location /stat.xsl {
- # XML stylesheet to view RTMP stats.
- # Copy stat.xsl wherever you want
- # and put the full directory path here
- root /var/www/stat/;
- }
- location /hls {
- # Serve HLS fragments
- types {
- application/vnd.apple.mpegurl m3u8;
- video/mp2t ts;
- }
- root /var/www;
- add_header Cache-Control no-cache;
- add_header 'Access-Control-Allow-Origin' "$http_origin";
- }
- location / {
- root /var/www/player;
- add_header Cache-Control no-cache;
- }
- # redirect server error pages to the static page /50x.html
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment