Friday, November 14, 2014

Рабочий конфиг nginx + ffmpeg

конфиг nginx

events {
    worker_connections 768;
}
rtmp {
    server {
        listen 1935;
        chunk_size 4000;
        application hls {
            live on;
            hls on;
            hls_path /etc/nginx/hls;
        }
        application dash {
            live on;
            dash on;
            dash_path /etc/nginx/dash;
        }
    }
}
http {
    server {
        listen      80;
        root /etc/nginx/;
        # This URL provides RTMP statistics in XML
        location /stat {
            rtmp_stat all;
            rtmp_stat_stylesheet stat.xsl;
        }
        location /stat.xsl {
            root /etc/nginx/;
        }
##
# location / {
#            root /etc/nginx/;
#        }
##
        location /hls {
            types {
                application/vnd.apple.mpegurl m3u8;
                video/mp2t ts;
    }
        }
        location /dash {
            root /etc/nginx/dash/;
            add_header Cache-Control no-cache;
        }
    }

[/spoiler]

конфиг ffmpeg

[spoiler]
ffmpeg -loglevel verbose -re -i rtsp://10.102.39.18:554/CH001.sdp -vcodec libx264 -s 320x240 -r 10 -threads 1  -vprofile baseline -f flv rtmp://localhost:1935/hls/movie &
[/spoiler]

No comments:

Post a Comment

grub2-install: error: disk `mduuid/e54081d398c6d57b4d67436f6d032162' not found

After raid 1 disk replacement faced with this issue # grub2-install /dev/sdb Installing for i386-pc platform. grub2-install: error: disk `md...