arut / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
13.35k stars 3.51k forks source link

HLS index and fragments randomly deleted #347

Open bunjiboys opened 10 years ago

bunjiboys commented 10 years ago

I am currently testing out nginx-rtmp and the only real problem I've been having is that every now and then, usually after 1-2 hours of streaming, all the .ts and the .m3u8 are deleted from the streaming folder. There are no reconnects from the source, and the rtmp_stat also shows that the source hasn't reconnected at all.

Configuration blocks added below

rtmp {
    server {
        listen 1935;
        ping 30s;
        notify_method get;
        on_connect http://localhost/ctrl/auth;

        application src {
            live on;
            hls on;

            hls_path /opt/sites/streams;
            hls_fragment 10s;
            hls_playlist_length 30s;
            hls_nested on;
            hls_fragment_slicing aligned;
            hls_type live;
        }
    }
}
server {
    listen 80;

    root /opt/sites/root;

    location = /favicon.ico {
        log_not_found off;
    }

    location = /ctrl/auth {
        allow 127.0.0.1;
        deny all;

        if ($arg_token = '<secret key>') {
            return 201;
        }
        return 403;
    }

    location = /stats/ {
        rtmp_stat all;
        rtmp_stat_stylesheet /stat.xsl;
    }

    location /streams/ {
        index index.m3u8;
        alias /opt/sites/streams/;
        types {
            application/vnd.apple.mpegurl m3u8;
        }

        add_header Cache-Control no-cache;
    }
}
arut commented 10 years ago

If they are deleted it means they are not updated for some reason.

bunjiboys commented 10 years ago

Are there any way to enable some more verbose logging from nginx-rtmp without enabling full debug mode. Mainly since this tends to only happen after a few hours, those would be some enourmous log files.

arut commented 10 years ago

Looks similar to https://github.com/arut/nginx-rtmp-module/issues/346

Sure debug log will be big